Writing a second video game for the Micro:bit in Rust
medium.com
medium.com
In my Rust I rely so heavily on the stdlib, and other crates, that it's hard for me to imagine working in an environment where I would not have access to that.
But the cool thing is that you can conveniently compose other no_std crates into your stuff. No more futzing about with m4 or global namespace collisions or did-they-leverage-some-weird-dependency-that-I-can't-build-here.
You aren't stuck with an entirely naked language.
can we get rid of this web dev made up word already?
It should be "compiles".
And, as sibling commenter noted, "transpilation" is a concept that predates the web itself, let alone "web devs."
Granted, there are a lot of situations where there is no need to make a distinction, but that's not always the case.
An analogy might be the use of the words car and taxi. Cars and Taxis are both vehicles. In fact, a taxi is often a car.
In some situations, I might say "I went there by car" - and that would be sufficient. But if the situation demanded I express the fact that the car that I traveled in was a taxi, I would say "I went there by taxi" (Not "I went there by a car that is owned by a freelance driver who charges by the kilometer")
This is why this "word" doesn't make any sense.
However, transcompile simply means source-to-source compiler. A subset of compilers.
Not all compilers take in source and spit out source: They can also output binary information.
So, the shortened "transpiler" doesn't hide that it is a compiler. It just means you get source code out, and put source code in.
They're being developed mainly for education and learning purposes.
The site is here: http://www.nevilhunt.com/zbit-connect/ but please be aware that this is quite a small operation, so you may not get any success
In my (entirely unresearched, and opinionated) mind, Lua is in spirit, an older, less expressive, version of python. I know there's some impressive and interesting jit/compiler projects around lua that make it great, but it doesn't seem to help with the actual problem I was facing, which was low ram.
The nrf51822 has 128kb ROM, and only 16KB ram, so any allocations that happen at run time are comparatively VERY expensive.
bitflyer has about (guestimate) 40kb of static resources, for bitmaps and music. This means those resources had to be static, and loading/managing them in ram is hard. As an example, to buffer the display in memory is 1/16th of your entire ram.
With rust, this meant that I effectively had a 14kb stack, that is almost guaranteed to be non-fragmented, (I haven't got round to measuring the actual stack size, but I think probably no more than a 3/4 Kb actually used on average) and no heap to worry about.
As far as I can tell, Lua uses a heap-based GC model which means unpredictable usage, and fragmentation.
Wow, that's a bit of a pity, yo. I don't think thats at all correct. They're completely different languages and ecosystems. Where Python has a fat history, Lua is mean and light.
>As far as I can tell, Lua uses a heap-based GC model which means unpredictable usage, and fragmentation.
Well, its all quite tweakable:
http://www.eluaproject.net/doc/v0.9/en_arch_ltr.html
EDIT: Mike Pall himself has weighed in on this subject, and I thought maybe you might to hear it straight from the horses mouth:
http://lua-users.org/lists/lua-l/2005-07/msg00221.html
.. though, with LuaJIT and eLua around now, things have changed a fair bit since 2005.
As for the eLua tweaks, things like rotables are quite cool, but ultimately you loose the ability to define them in lua, so, like micropython, it's doable, but just means you sacrifice the non-c nature of it to do so. :)
And I think if you look at popularity in, say, 2000, Python was much more widely known by then.