keywords
yaegi
keywords | yaegi | |
---|---|---|
6 | 39 | |
184 | 6,642 | |
- | 1.6% | |
2.8 | 5.8 | |
11 months ago | 15 days ago | |
Go | Go | |
GNU General Public License v3.0 or later | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
keywords
-
Fourteen Years of Go
> I'm not sure here how you differentiate minimalist from restrictive.
The flexibility of the language and its syntax. The more constructs are syntactic, the less minimalistic it is, and Go is a very syntactic language.
> I've always considered Go to be minimalist in terms of available tokens to the programmer: https://github.com/e3b0c442/keywords/blob/main/chart.png
No language on this chart has even a passing resemblance to minimalistic. I don't think anything does when it reaches double digit keywords.
For reference, I believe Smalltalk has 6.
And forth is more complicated because it doesn't really have keywords at all, and barely any syntax, instead it has assembly-coded / runtime-provided words (~functions) and variables. SectorForth (https://github.com/cesarblum/sectorforth/) is down to 8 builtin words, 2 IO words, and 5 variables (milliforth packs those behind a word instead). And so far 2 of the words have been found unnecessary / redundant.
- So, What's the Advantage of Having Minimal Built-Ins?
-
C++ at the End of 2022
> I like Rust's pragmatism.
Me too.
But Scala is also a very pragmatic language. If you want something academic go for Haskell.
> Allow limited operator overload.
Nitpick: Scala does not have any operators. So it doesn't have operator overloading at all.
Scala simulates operators by infix method syntax.
Instead of writing `1.+(2)` you can just write `1 + 2`. But the later is the same method call as the first one!
> Eschew HKT for a simpler abstractions.
AFAIK HKTs are more or less "just postponed" in Rust, AFAIK.
People would like to add them of course. The discussion goes on forever by now. Some small insight (there is much more when you look for it):
https://github.com/rust-lang/rfcs/issues/324
https://internals.rust-lang.org/t/higher-kinded-types-the-di...
> Don't go in the deep end with type power, nor too much in opposite direction and avoid any complicated feature.
While having a full ML style type system with afine types on top, and quite some other type level mechanics up to singleton types?
Sure sure, no power in here. :-)
> The more powerful feature the more abusable it is, and Scala loves the power at all cost.
Everything is "abusable". This is not an argument.
But that Scala loves power at all cost is simply not true. The contrary is.
Just to cite one of the most influential post in Scala land of all times:
https://www.lihaoyi.com/post/StrategicScalaStylePrincipleofL...
This, and the BDFL constantly complaining about unnecessary complex code people write speaks for itself.
Scala lately even reduced the power of some features just to prevent "abuse". (Which is partly an overreaction; but that's another story).
> Why would anyone care? The more flexible/powerful something is the harder it will be to parse by humans and tooling.
That's also not true.
Scala has a very small and simple syntax (despite all the language features).
Scala is on the surface much much simpler and much more regular then Rust!
https://github.com/e3b0c442/keywords
(You could also compare the language grammars. This would be even more in favor of Scala in this regard).
Scala 3 looks even almost like Python!
https://docs.scala-lang.org/scala3/book/scala-for-python-dev...
> Plus Scala has the big deal breaker. GC and no custom primitive types.
What a "deal breaker"?
https://github.com/carbon-language/carbon-lang/blob/trunk/do...
You've seen this here in the thread?
Also:
https://docs.scala-lang.org/overviews/core/value-classes.htm...
As soon as Valhalla lands in JVM-land this will be full blown value types without any limitations.
And in Scala Native you can have of course native structs today. (Only that Scala Native isn't ready for prime time just now).
In the long run Scala Native could also run without GC. The Caprese project will bring something that is more powerful than Rust lifetimes. Lifetimes will fall out as a special case of a more general concept.
> > Besides that: The Rust people are looking envious. I've read about some ideas that were more or less a direct copy of Scala's implicits.
> What do you mean exactly?
Implicits get discussed every now and than in Rust land. Even the above Rust internals discussion start with them.
Or this here:
https://tmandry.gitlab.io/blog/posts/2021-12-21-context-capa...
Also I've once read something that looked like a brain storming for future Rust features. They came up with more or less implicits (only that they didn't call them like that, so I can't find this any more, didn't bookmark it).
Someone even once proposed directly Scala's implicits for Rust. But this went nowhere as the other people on the forum actually didn't understand them (which was no wonder as the example was quite terrible and the proponent was not really experienced with Scala so couldn't explain it well). People came than to quite wrong conclusions (some of them even mixed implicits in general even the dreaded implicit conversions, which were in fact mostly overused and caused trouble in Scala; but things got redesigned exactly because of that).
-
What are the "meta principles" for all programming languages?
Check out: https://github.com/e3b0c442/keywords
-
How would you rate the following languages in order of difficulty?
In order to actually answer your question in some form: Here’s a list of programming languages ranked by number of keywords.. Looking at this list, consider that PHP used to be considered a beginner friendly language and that Java is often chosen as the first language for new CS students. Your question seems to be difficult to answer!
yaegi
- Traefik/Yaegi: Yaegi Is Another Elegant Go Interpreter
-
Go: What We Got Right, What We Got Wrong
Yes. There are long standing feature requests for (e.g.) the reflect package that simply don't get done because they'd break this assumption and/or force further indirection in hot paths to support "no code generation at runtime, ever".
Packages like Yaegi (that offers an interpreted Go REPL) have "know limitations, won't be addressed" also because of these assumptions.
https://github.com/golang/go/issues/4146
https://github.com/golang/go/issues/16522
https://github.com/traefik/yaegi?tab=readme-ov-file#limitati...
- Fourteen Years of Go
-
Gojekyll – 20x faster Go port of jekyll
There is always https://github.com/traefik/yaegi - a Go interpreter written to make it easy to write plugins.
- Jacobin: Minimal JVM written in Go and capable of running Java 17 classes
-
Can Go run statements in cmd like Python?
I think https://github.com/traefik/yaegi comes as close as using the python interpreter in you CLI, but for Go
-
Can Go files be compiled by themselves?
There's a go interpreter: https://github.com/traefik/yaegi It could run programs without compiling them, but there're some limitations.
-
referencing packages on the internet and using go plugin
I'd recommend looking into a different approach for plugins such as hashicorp/go-plugin (which uses multiple process PIDs and RPC communication between them) or traefik/yaegi (which implements a Go-compatible scripting language that can be interpreted at runtime and which still supports most Go modules).
-
Mun v0.4.0: a statically-typed scripting language like Rust, written in Rust
Why do we need a language like Rust when we have Rust. Why not just create a Rust interpreter. (There's such an interpreter for Go, BTW, https://github.com/traefik/yaegi )
-
Plugo - A plugin library for Go.
A cool solution I saw was Traefik's yaegi module. They basically created an interpreted scripting language with Go compatible syntax (turning Go into an interpreted, not compiled, language). I haven't tried this but it sounds like it brings the better parts of dynamic languages like Python's plugin support to Go - plugin writers can still write "Go" code, which can load dynamically.