TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Berry is a ultra-lightweight dynamically typed embedded scripting language

266 pointsby dannyobrienover 1 year ago

24 comments

nine_kover 1 year ago
A surprisingly rich feature set for a 40-KB runtime: a VM with GC that runs a Python&#x2F;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&#x27;t have with MicroPython or Lua, AFAICT, and this makes a lot of difference in MCUs where ROM &#x2F; flash is plentiful, and RAM is scarce.
评论 #37805040 未加载
评论 #37805041 未加载
评论 #37809340 未加载
评论 #37805359 未加载
RunningDroidover 1 year ago
Note that Berry is used by Tasmota: <a href="https:&#x2F;&#x2F;tasmota.github.io&#x2F;docs&#x2F;Berry&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;tasmota.github.io&#x2F;docs&#x2F;Berry&#x2F;</a>
评论 #37807877 未加载
runlaszlorunover 1 year ago
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.
ginkoover 1 year ago
I guess the main questions I&#x27;d have would be:<p>What&#x27;s the performance &amp; memory usage compared to Lua?<p>How sandboxable is it? Can you run untrusted code through it?
评论 #37802450 未加载
评论 #37801857 未加载
评论 #37802545 未加载
happensover 1 year ago
I&#x27;d love something exactly like this, but with less paradigms and statically typed, for use as a configuration language.<p>I&#x27;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&#x2F;python, which feels so much better to me. I&#x27;m always missing autocompletion and reflection though. There doesn&#x27;t seem to be a good candidate for this, pretty much all small embeddable scripting languages are dynamically typed...
评论 #37805051 未加载
rcarmoover 1 year ago
Looks nice. I&#x27;m still rather partial to uLisp (<a href="http:&#x2F;&#x2F;www.ulisp.com" rel="nofollow noreferrer">http:&#x2F;&#x2F;www.ulisp.com</a>), but it&#x27;s great to see this.<p>Erm... Berry good :)
评论 #37807576 未加载
0x6461188Aover 1 year ago
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:&#x2F;&#x2F;github.com&#x2F;berry-lang&#x2F;berry&#x2F;tree&#x2F;master&#x2F;examples">https:&#x2F;&#x2F;github.com&#x2F;berry-lang&#x2F;berry&#x2F;tree&#x2F;master&#x2F;examples</a>
Syttenover 1 year ago
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.
MrBuddyCasinoover 1 year ago
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.
评论 #37803062 未加载
nightowl_gamesover 1 year ago
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?
traversedaover 1 year ago
I think the thing I&#x27;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.
评论 #37802862 未加载
评论 #37803027 未加载
germandiagoover 1 year ago
Any chance Berry has something like generators or function resumption of some kind? I usually use scripting in interactive stuff such as games.
评论 #37816425 未加载
dvdkonover 1 year ago
This looks nice, especially the small runtime. One nitpick: Why not &quot;if&quot; expressions, or even &quot;for&quot; expressions? Ternary operators aren&#x27;t something any new language should copy. It might even reduce parser code.
Pxtlover 1 year ago
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&#x27;s idiosyncratic language decisions that come from its age.
CharlesWover 1 year ago
What are some reasons this is interesting when great embedded JavaScript&#x2F;TypeScript runtimes (like Moddable&#x27;s XS, which runs on microcontrollers with as little as 32 KB RAM) exist?
评论 #37805746 未加载
评论 #37809935 未加载
vitiralover 1 year ago
Seems cool, has a lot of the Vibe of Lua but with bit-twiddling types
antifaover 1 year ago
I wonder if anyone is forking love2D to use berry instead of&#x2F;in addition to Lua?
alberthover 1 year ago
Off topic: Any good resources on how to create your own language?<p>(eg syntax, compilation, etc)
评论 #37811773 未加载
评论 #37811313 未加载
评论 #37809998 未加载
influxmomentover 1 year ago
Don&#x27;t care for the way they do exceptional handling. Make errors part of the type system
评论 #37805060 未加载
spacechild1over 1 year ago
No coroutines :-(
评论 #37807505 未加载
bwanabover 1 year ago
There&#x27;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.
评论 #37803254 未加载
评论 #37804207 未加载
评论 #37803181 未加载
评论 #37803034 未加载
i_am_a_squirrelover 1 year ago
Their marketing page loaded absurdly fast
评论 #37803025 未加载
Borg3over 1 year ago
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.
geenatover 1 year ago
<a href="https:&#x2F;&#x2F;hyperscript.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;hyperscript.org&#x2F;</a>
评论 #37804556 未加载
评论 #37804356 未加载