68 points · by mr_ms · 4y ago · 21 comments
Umka is a scripting language with syntax inspired by golang. A language with its own vm that you can embed anywhere, exsmple: https://github.com/vtereshkov/umka-lang/blob/master/examples....
Yaegi and Umka are two different things.
Edit: of course you can have a golang program that uses yaegi to execute your arbitrary script, and call into it this msin program from C. But how effective is it?
From the looks of it not really. They're language implementations designed for embedded use. The only difference in design is that Umka is in C and Yaegi is in Go.
But yes it's true that it's easier to call into C libraries than it is to call into Go libraries. But you can call into Go libraries from other languages.
Yes. But it’s far from “embedded”. You can compile golang to a shared library. But that’s still far from “embedded”. Hence my question: how practical is it, really.
[1] https://github.com/traefik/yaegi#as-a-command-line-interpret...
Yaegi was built with a very narrow use case: golang plugins for Traefik proxy. It’s a golang library for evaluating golang code. That’s it. You can go through the hoops of calling from C into a golang program that then evals some other golang code via Yaegi but that’s probably not going to be the most efficient way of doing it and it’s far from embedded. So yeah, if you have an existing golang program and needs scripts with everything what golang offers, go for Yaegi.
Umka solves a different problem.
I can see that as currently the umka tooling is pretty lacking.
Multiplication of 2 400x400 matrices takes about 25 seconds, compared to more than 50 seconds for Python. But in Python everybody uses numpy to multiply matrices, and at this size the runtime is less than 1 millisecond on any recent CPU.
Anyway I think the benchmark is underwhelming for a different reason - Python is extremely slow so beating it surely isn't that Impressive?
I guess on the other hand... one guy has made a faster language than one made by an entire army of Python developers.
That said, I don't know what the goals of this language are, and bluntly, perf isn't everything ;)
Since the most popular scripting language is Lua, I can name three big disadvantages of Lua that Umka is trying to fix:
- Verbose and unfamiliar syntax
- Type error detection at run time instead of compile time (a direct consequence of dynamic typing)
- Data structures not compatible with C (which is particularly odd, as Lua is specifically designed to interact with C)
So yes, Umka's main goals are not related to performance.
The creators of Umka chose their own benchmark to show people how good Umka is. It's the first thing you see when you open the github page. They could have chosen anything else, but they chose a matrix multiplication benchmark. Is matrix multiplication relevant for the Umka use case? I don't know, but if it is, the relevant comparison point is Python+Numpy, not Python alone. In which case rather than Umka being twice as fast, Umka is about 10000 slower.