News for hackers. Stuff that matters.
Re:Berry is a ultra-lightweight dynamically typed embedded s... by bwanab on Saturday October 07, 2023 @12:13PM (#37802930)
There's got to be an xkcd strip on the trajectory of computer languages:

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.

Re:Berry is a ultra-lightweight dynamically typed embedded s... by xonix on Saturday October 07, 2023 @12:38PM (#37803181)
True. Probably, only AWK is an exception.
Re:Berry is a ultra-lightweight dynamically typed embedded s... by vitiral on Saturday October 07, 2023 @03:32PM (#37804780)
And Lua
Re:Berry is a ultra-lightweight dynamically typed embedded s... by runlaszlorun on Saturday October 07, 2023 @12:46PM (#37803254)
I’d think this actually applies to nearly everything in software and is def a useful thing to keep an eye on.

Underemployment for the last 3 years has given me a great opportunity to dive deeper into a lot of CS topics for things we use daily and read (or at least try to read) specs and code bases etc.

I’ve come to firmly believe that languages or other open source projects that get popular, usually do so for the things that are in its early versions.

For example, the HTTP 0.9 spec is like 1 page. UDP is like 3 pages.

I’d seen an article on HN recently (cant remember the name) that described this well. A language or what not starts simply and many jump on the bandwagon. Then starts adding incremental features, none of which are difficult to incrementally learn for existing users but the footprint of the product keeps expanding. C++, Javascript, Web APIs, graphics languages like OpenGL all are examples in my eye.

The fact that our system (broadly speaking) incentivizes inventing something ‘new’ rather than fixing or simplifying an existing something certainly exacerbates this.

Re:Berry is a ultra-lightweight dynamically typed embedded s... by carapace on Saturday October 07, 2023 @02:27PM (#37804240)
When I try to explain this to non-programmers I often use this metaphor: Imagine that you enjoy mountain climbing, but the act of climbing the mountain causes more mountain to rise above you.

That's what we see in software development: a runaway process of elaboration and ever-increasing complexity and levels of abstraction.

Re:Berry is a ultra-lightweight dynamically typed embedded s... by vitiral on Saturday October 07, 2023 @03:32PM (#37804777)
Lua has done pretty well to avoid this IMO. Notably they added coroutines with basically zero cost to the implementation (essentially just a pointer keeping track of function position on top of the already existing closures). The whole language is incredibly constrained yet powerful
Re:Berry is a ultra-lightweight dynamically typed embedded s... by vram22 on Sunday October 08, 2023 @03:47AM (#37808624)
>I’d think this actually applies to nearly everything in software and is def a useful thing to keep an eye on.

Sort of like if the Peter Principle and Parkinson's Law had a child.

https://en.m.wikipedia.org/wiki/Peter_principle

https://en.m.wikipedia.org/wiki/Parkinson%27s_law

Or just Zawinskis Law:

https://en.m.wikipedia.org/wiki/Jamie_Zawinski#Zawinski's_La...

Re:Berry is a ultra-lightweight dynamically typed embedded s... by IshKebab on Saturday October 07, 2023 @02:23PM (#37804207)
1. Dynamically typed!

2. Ok that didn't work too well we've added static type hints.

Does anyone know of any good embedded statically typed languages? It seems to be a very unexplored design space. The only real ones I know of are AngelScript (which catastrophically fails rule 0 of programming languages) and Gluon which is just a bit too weird and aggressively functional for me.

Re:Berry is a ultra-lightweight dynamically typed embedded s... by zkldi on Saturday October 07, 2023 @02:34PM (#37804296)
What's rule 0?
Re:Berry is a ultra-lightweight dynamically typed embedded s... by IshKebab on Saturday October 07, 2023 @04:25PM (#37805216)
Show examples on the main web page.

Try and find an AngelScript example. It's stupidly hard. Compare it to these web sites:

https://dlang.org/

https://koka-lang.github.io/koka/doc/index.html

https://vale.dev/

http://mu-script.org/

https://go.dev/

https://www.hylo-lang.org/

Sadly Rust fails this too but at least the Playground is only one click away. And Rust is mainstream anyway so it doesn't matter as much. I completely failed to find a single AngelScript example accessible from my phone's browser. Even its Wikipedia page doesn't have any.

Re:Berry is a ultra-lightweight dynamically typed embedded s... by vitiral on Saturday October 07, 2023 @03:34PM (#37804801)
I made a prototype that works in 3000 lines of C

github.com/civboot/fngi

It was super fun. I'm going to be going in a different direction (Lua implemented in Lua, with Lua-library assemblers and assembly type system), but it's certainly very possible

Re:Berry is a ultra-lightweight dynamically typed embedded s... by IshKebab on Sunday October 08, 2023 @04:28AM (#37808789)
Nice! Pretty interesting syntax. Not sure about / for comments or the function argument syntax but you have a solid point about not using " or ' for strings!
Re:Berry is a ultra-lightweight dynamically typed embedded s... by vitiral on Sunday October 08, 2023 @09:58AM (#37810492)
Thanks :)

FYI the real power of / for comments is /token to comment out one token. So useful to add a bit of doc sugar when calling something

    call(x\sugar)

    call(x/*sugar*/)
Also

    Thing \(inline comments) other
Re:Berry is a ultra-lightweight dynamically typed embedded s... by emmanueloga_ on Monday October 09, 2023 @03:08AM (#37817812)
Perhaps Roblox's Luau? It is Lua with gradual types and a sandbox-enabled VM [1]. "Luau aims to be backwards-compatible with Lua 5.1", so yep, still 1-based array and string indexing :-).

--

1: https://luau-lang.org/sandbox