Better HN
topnewbestaskshowjobs
Log inSign up

withtypes

107 karma · joined Aug 19, 2009 (17y ago) · 52 submissions

I love types!
Submissions

1.

Writing Rust the Elixir way – 18 months later(lunatic.solutions ↗)

7 points · by withtypes · 4y ago · discuss

comment 5y ago · link · parent

In Rust there is smallvec https://docs.rs/crate/smallvec/

comment 5y ago · link · parent

Fly.io is doing cool stuff! We will try out their platform to deploy Lunatic to the edge.

comment 5y ago · link · parent

Wasmtime/Wasmer are both written in Rust so it was easy to integrate them. By the way, Wasm3 is an interpreter, not a JIT compiler, but this also has some use cases! For example, running an instance from “cold storage” requires a JIT compilation step which might take more time then just interpreting it. It would be cool to have a fast interpret like Wasm3 too.

We’ve created a crate “uptown_funk” which enables us to write Rust code which easily integrates with both Wasmer and Wasmtime. It was very helpful in implementing WASI and it takes a little bit different approach than Wasmer and Wasmtime. Regarding, Wasmer vs. Wasmtime, we don’t have a preference yet, both are great!

comment 5y ago · link · parent

We agree with you, we are currently focused only on runtime running on an existing OS. We know there are different uses-cases so we could organize the project so that you can use what you need. In theory, you could use it right now inside of your Rust app to run plugins as Lunatic processes, but we need to document it a little bit better and maybe showcase an example.

comment 5y ago · link · parent

We will take a look at embly! For Rust currently you just have to add wasm32-wasi target and compile for it. There are still some problems (WASI is not yet finished, maybe binary size could be optimized). Our current idea is to build a small cargo command which would do building and deploying. Wasmer is doing great work with tooling for other languages. We are now focused on Rust and AssemblyScript, but as Wasm and WASI mature we would like to simplify it for more languages.

We have been thinking about live process migration. I’m planning to do a demo where we run a lot of board games (e.g. chess) on authoritative servers using Lunatic. Then we give a developer ability to move a live game to a different machine without players noticing. We are still working out the details, but that area also excites us!

comment 5y ago · link · parent

You are thinking in the right direction, but there are some technical differences between how NodeJS works compared to Erlang or Go. For example, in NodeJS you could accidentally block the event loop by some unintended computation, but Lunatic and Erlang periodically give control back to the runtime. We also want to abstract the syscall layer, for example, in our lunatic.run demo, you write a program which seemingly uses standard input/output but we actually read/write from a socket.

By the way, if it sounds vague, that's important info for us, we have to improve that!

8.

Launch HN: Lunatic (YC W21) – An Erlang Inspired WebAssembly Platform

162 points · by withtypes · 5y ago · 39 comments

comment 5y ago · link · parent

I don't read it like that at all. Rust is mentioned only once. Nevertheless I do care if a tool I am considering to use is written in JavaScript, Rust or some esoteric language. It means a lot, not only for "safety" which is not important to you that much, but also for maintainability, community, and the future of the project. Of course, what triggers you probably is mentioning Rust in the title of the post. Still hard to imagine being so annoyed by it–if authors thinks it's important or it will grab attention, why not use it...

comment 6y ago · link · parent

Saying Lean "rules out many kinds of mathematics" and not giving a single example, sounds more sensationalist to me. I also don't see what's wrong with anonymous comments as long as they are constructive and people are nice.

I don't know Kevin as well as you do (apparently) but maybe he is just ignorant on the topics you know so much about. Why something gets attention of media (Quanta Magazine?) is complicated. From your comments, you also seem very "bold".

comment 6y ago · link · parent

I'm a beginner in proof assistents, can you give some examples of many kinds of math ruled out? And what is UIP?

comment 6y ago · link · parent

> Why start calling things 2-vectors, when you could call them 2-forms and people would know what you were talking about?

There is more to 2-forms. Also, to be precise, they are functions from a vector space to the scalar field (usually reals). Sure, they form a (dual) vector space but I think it would be more confusing to call GA elements k-forms.

comment 6y ago · link · parent

I would argue that trying to describe our physical world and reality has only one "axiom" which is: your description has to be consistent with our observations of the world. Mathematics doesn't have this limitation so I don't think your example is valid. If you don't like LEM, fine, maybe there is something interesting in systems without LEM, but most math is done with LEM. I don't think is a matter of "right" and "wrong".

comment 6y ago · link · parent

I don't understand what "LEM is false" means. What are your starting assumptions that lead to the "LEM is false" conclusion? You can use/assume LEM in your system or not, most mathematicans assume LEM (without even thinking about it).

comment 6y ago · link · parent

I also think that this point should be emphasized more. It helped me a lot when I realized it. I also liked the abstract approach to vector spaces. Of course, a matrix is just one way to represent linear transformations and it can also represent other things like a system of linear equations.

comment 6y ago · link · parent

Obviously "more powerful" doesn't imply the capability of solving the halting problem. What exactly do you want to say? You are not impressed with "differentiable programming"?

comment 6y ago · link · parent

I don't have this impression. Can you explain?

comment 6y ago · link · parent

I think you are wrong. Yes, better understanding of hardware implementation (cache sizes and latency, branch prediction and pipelines, specialized instructions) is important. But also in real life those asymptotic complexities will often have similar c and N_0, or your input will be bigger than N_0, so O(n) vs O(n^2) will still matter. Basic analysis of algorithms makes your life easier because, in this simplified model, you can get a rough estimate of time/space requirements. Of course, if you have competing implementations, you will benchmark them (which is not straightforward to do properly).

By the way, usually we use "complexity theory" for a part of theoretical computer science (math) concerned with proving lower bounds (like the most famous P vs. NP). What is required for basic analysis of algorithms (without any fancy methods) is not very hard. Yes, you can search the web like we all do, but first you need to know what are you searching for. Also, we reuse algorithms/data structures but not only in the final product but also in our own new algorightms so you cannot search it.

Regarding interviews, I think the main problem is that many companies and interviewers try to blindly copy the questions (cargo cult) without understanding the point of such interviews. The point IMO is that you evaluate analytic skills of a candidate. Correct/incorrect answer is not everything. You could do the same with math, science problems but algorithms/data structures are closer to programming. Anyway, I feel this is becoming a controversial topic.

comment 6y ago · link · parent

Do you have examples of languages which don't encourage you to use array of structures?

comment 6y ago · link · parent

To clarify, I use "programmer" when speaking to very non-technical people, usually elderly. Many other languages have a similar word but it might have different connotations, for example, be less negative (pejorative).

comment 6y ago · link · parent

What does the word "developer" mean to other people? If you want to keep it simple, why not "programmer"?

Depending who I talk to, I use "programmer" or "software engineer" most often.

comment 6y ago · link · parent

* "Engineering is the use of scientific principles to design and build machines, structures, and other items"

* Mathematics isn't only about calculation and applied physics. When you write a simple algorithm and convince yourself with a logical argument about its correctness, time complexity, etc. that is math too. You also do calculations when you design various systems (latency, throughput, etc.)

* I know a dozen mechanical, structural, and electrical engineers. They almost never model anything from first mathematical principles, they use well known tools and methods they learned. Their "nail guns and glue". Actually I think most of them don't understand math/physics behind it very deeply. So even if those methods are underpinned with mathematics and physics, it's abstracted away most of the time which is good for practical purposes.

Even in "user-interface programming", I often had to use math, algorithms, etc. In other parts of software engineering I used it much more.

comment 6y ago · link · parent

I think it's both about abstraction and compile time optimization. The point was that by default you can write code that uses higher level abstraction but compiles to the same code as an imperative-style loop. Most used languages or default implementations don't use LLVM, moreover they are interpreted or JIT compiled, so there might be different performance between e.g. for-loops vs. forEach with a closure.

comment 6y ago · link · parent

Usually in Rust community zero cost means zero runtime cost. Obviously, there are many other costs you could define.

comment 6y ago · link · parent

It seems the post is a response to SIGGRAPH 2019 course “Geometric Algebra for Computer Graphics” and not a stand-alone introduction to GA. Maybe the title suggests otherwise. That explains why there are no figures. I have a basic knowledge of GA but everything seemed clear. I was confused a little bit by "anti-scalar" which is usually called "pseudo-scalar".

comment 7y ago · link · parent

What is a modern passphrase? Or modern OpenSSH?

comment 7y ago · link · parent

How do you enforce it?

comment 7y ago · link · parent

I've just run it and it works! I didn't know about the macro.

comment 7y ago · link · parent

I teach people that there are many ways to encode numbers into 0, 1 symbols (state of switches). One obvious way for natural numbers is base-2 (with more significant bits on the left). It get's more complicated with negative numbers (two's complement usually, but could also be one sign bit). Floating point numbers are hard. You could also use variable length integers where small numbers are represented with less bits and you use one bit to mark end of a number (every 8 bits).
12