A surprisingly rich feature set for a 40-KB runtime: a VM with GC that runs a Python/Ruby lookalike language, supporting procedural, OO, or functional styles. From the cursory look, seems pretty ergonomic to write.<p>What stood out for me is the ability to pre-create constant objects and put them mostly into ROM, so that the RAM is only used for the actually mutable data. This is something you can't have with MicroPython or Lua, AFAICT, and this makes a lot of difference in MCUs where ROM / flash is plentiful, and RAM is scarce.
Note that Berry is used by Tasmota: <a href="https://tasmota.github.io/docs/Berry/" rel="nofollow noreferrer">https://tasmota.github.io/docs/Berry/</a>
Man, this looks great. And, personally, I think this is some of the best documentation I’ve seen. Kudos to those who put it together! I love the “short manual” for experienced devs to quickly get a sense of the language. And I wasn’t familiar with Tasmota before but def will be looking for an excuse to try it on a project.
I guess the main questions I'd have would be:<p>What's the performance & memory usage compared to Lua?<p>How sandboxable is it? Can you run untrusted code through it?
I'd love something exactly like this, but with less paradigms and statically typed, for use as a configuration language.<p>I've used several projects requiring non-trivial configuration that, instead of requiring you to write hundreds of lines of yaml, simply let you write Lua or Starlark/python, which feels so much better to me. I'm always missing autocompletion and reflection though. There doesn't seem to be a good candidate for this, pretty much all small embeddable scripting languages are dynamically typed...
Looks nice. I'm still rather partial to uLisp (<a href="http://www.ulisp.com" rel="nofollow noreferrer">http://www.ulisp.com</a>), but it's great to see this.<p>Erm... Berry good :)
If like me you like to look at examples of code to get a feel for the language, take a look at <a href="https://github.com/berry-lang/berry/tree/master/examples">https://github.com/berry-lang/berry/tree/master/examples</a>
It would be very nice to provide bindings to other languages. We use quickjs from rust and it works pretty well, you can provide what you want to the VM so it can run untrusted code.
This looks like a language optimized for embedded use. It looks well designed and documented, and doesn’t do anything stupid or unexpected. The syntax is pleasantly minimalist and tasteful. I‘ll definitely keep it in mind for my next ESP32 project.
Is there a standard approach to making native stack traces capable of marking stack frames with the name of the scripted function? Like when you get a crash or use a cpu profiler, is it possible to interleave native and script stack traces?
I think the thing I'd miss most from python if I was using this is multiple-inheritance. Not even necessarily true multiple inheritance, but at least some kind of mixin.
This looks nice, especially the small runtime. One nitpick: Why not "if" expressions, or even "for" expressions? Ternary operators aren't something any new language should copy. It might even reduce parser code.
It looks neat. But the goals sound very similar to venerable old Lua. I wonder what Berry has to set it apart from Lua, besides a few of Lua's idiosyncratic language decisions that come from its age.
What are some reasons this is interesting when great embedded JavaScript/TypeScript runtimes (like Moddable's XS, which runs on microcontrollers with as little as 32 KB RAM) exist?
There's got to be an xkcd strip on the trajectory of computer languages:<p>1. Starts out fast, compact and lightweight.
2. Bugs and corner-cases get fixed.
3. Features demanded by users get added.
4. No longer fast, compact or lightweight.
Hmm, written in C99 :) Thats super cool, considered its very new language.
It can even run on my ancient toaster ;) I will keep an eye on that project.
For now im happy with old Ruby.