dsrw
That's the feeling I'm trying to capture with Enu. I'm sure it won't land for a lot of people, and that's ok, but I hope someone out there finds it and makes something really amazing, even if they're the only one who can see it.
Enu was designed to be usable by non-readers and new typists. There's a shorthand version of common commands, and as long as you're happy with 90 degree angles you can specify direction without numbers. For example, a box could be:
f 10 # forward 10
r 10 # right 10
b 10 # back 10
l 10 # left 10
or: 4.x: # 4 times
f 10 # forward 10
t r # turn right
It can also be configured to interpret both `;` and `:` as `:`, which makes it possible to type a lot of common Enu code without needing the SHIFT key.Enu only recently got to a state that I'd consider usable, so whether or not this is enough to make it work for younger kids, I'm not sure. But I'm hopeful.
In python, for historical reasons the logging module uses camelCase while most other modules use snake_case, so it isn’t really possible to use the logging module and maintain a consistent style. This is a non-issue in Nim.
Enu is powered by the belief that text based programming can be accessible to kids if made simple enough, and that text is more flexible than visual programming using tools like Scratch and Game Builder Garage. I still have lots of work to do to improve discoverability, but based on my experience using it to run a coding club and teaching my own children, I believe the theory mostly holds. It's inspired by Logo and Minecraft, has a terse syntax for building nested state machines (although it calls them Command Loops), and tries to make it possible to build full games using only simple concepts like loops and conditionals.
I've been working on Enu for almost 4 years now (very much part time) and have put out a few releases already, but I believe this is the first version that really captures what Enu is all about. Let me know what you think!
Enu: Learn to code and build 3D games in Nim
The first real MVP of Enu will be releasing before the end of the month. 1.0 is years off, but the basics are mostly there and it seems like a good time to put up a web site, write some docs, and see if people actually want to use the thing.
Currently Enu is just a consumer of Godot. I’ll update the description soon. Thanks for the interest!
JS aside, I think there's probably some survivorship bias going on here. I don't think there are a lot of 15 year old, relatively unpopular languages that are still under active development. Maybe it's not that languages that don't become popular in 10 years never will, but rather that languages that don't become popular in 10 years tend to be abandoned by their developers, thus sealing their fate.
I use it to teach kids to code. The released version is pretty rough and probably not fit for general consumption, but the next release (coming next month... I hope) is quite a lot better.
https://youtu.be/9e9sLsmsu_o is a demo making a simple survival game, and https://youtu.be/upg77dMBGDE is a now very outdated demo building towers and other simple structures. Thanks!
In no particular order, things I like about Nim:
- It has most of the benefits of a scripting language, without most of the tradeoffs. Hello World is a one-liner, there isn't much syntactic noise, and it's very easy to write short, simple, useful programs that look like pseudocode, live in a single file without any dependencies, and can be kicked off with a shebang line. However, unlike scripting languages, it scales very well to large projects.
- Progressive disclosure. You can use Nim effectively while knowing very few of its features, but there's a lot of functionality available when you're ready.
- The "if it compiles, it works" factor is quite high. Not as high as Rust or Haskell, but higher than Java or Go, in my experience.
- The "it compiles on the first try" factor is also quite high. Higher than any language I've tried. "I wonder if this will work..." code usually does, the advanced features of the language mostly stay out of the way until you need them, and I rarely find myself working just to make the compiler happy. Just as an example, unless you add specific constraints, generics are "duck typed". If I pass a type to a generic proc the compiler will verify that it has the properties and functions the proc needs, but I don't have to define a specific interface up front.
- Similar to the above, the productivity vs safety balance seems right, at least for me. Code is fairly safe by default, but it's easy to work around the compiler if you need to do something it doesn't want you to do. It's also pretty easy to enforce additional safety when you need it, like ensuring a function can't throw exceptions or have side-effects.
- It's very good at building abstractions and eliminating boilerplate. Nim templates and generics are easy to use and quite powerful, and macros are there if you need something more advanced. Many features that need explicit compiler support in other languages, like async/await and string interpolation, are implemented in the Nim sdlib with macros, not the compiler.
- Nim produces standalone binaries that are both small and fast.
- The compiler is faster than most.
- The compiler can be imported as a library, making it pretty easy to write tools that understand Nim code.
- Nim programs are usually compiled, but there's also an interpreter. The compiler uses this for macro evaluation and for running build scripts, and it's easy to embed if you want your program to be scriptable.
- Nim can run on pretty much anything.
- Nim can be used to build almost anything. You can use it for systems programming, webdev (frontend and backend), games, ML, scripting, scientific computing, and basically anything else. There are definitely some domains where library support is lacking currently, but the language itself is suitable for any type of program.
- It's very flexible. Most Nim code is imperative, but it's easy to write functional, declarative, or OO style code if that's your thing.
If you prefer languages like Go that favor an abstraction-free style, where everyone's code looks more or less the same, you probably won't like Nim. However, if you want something more expressive like Ruby or Lisp, but don't want to sacrifice performance or safety, Nim is definitely worth a look.
He didn't cargo cult his software into the ecosystem. He made the ecosystem. Nimble is the package manager because there was no package manager until dom wrote one. Jester is the default web framework because it was first, and despite its age it's still pretty good. Same for choosenim. And asyncdispatch. And all of the other tools/libraries that he wrote.
Obviously writing some early software doesn't give him a free pass. I could understand the attitude if he was a jerk, but I've never seen him be anything but helpful.
In my opinion, this is the correct default, at least for Nim. Operator overloading and UFCS (https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax) don't really work if I have to prefix everything with a module name, and the static nature of Nim means that I'll get a compiler error if there's any ambiguity. There are downsides as well, but language design is all about tradeoffs, and I think Nim got this one right.
Regarding the case insensitivity, I was initially put off by this as well, but in 2 years of using Nim as my primary language, I have never, ever, encountered a real-life issue with it. I've never seen a Nim code base that uses mixed casing, and never encountered or heard of a bug caused by this behaviour. However, it has allowed my own code bases to stay 100% consistent, regardless of the code style of my dependencies, even when those dependencies written in other languages. Contrast this with Python where the `logging` module uses different casing than everything else, so you're forced to use an inconsistent style if you want to consume it. This type of thing is a non-issue in Nim. I think a case sensitive Nim would still be a fine language, but in my experience the pros of being mostly insensitive outweigh the cons.
In the end you may still disagree with both of these decisions, which is fine. Just understand that it's a nuanced discussion, and there's some solid reasoning behind their choices.
It could definitely be better, and hopefully some day it will be, but I use Nim in a debugger quite frequently and it usually works out pretty well.
A few suggestions that may or may not be helpful:
- I realize that this is a big part of your esthetic, but blocky "game fonts" are hard to read. They're fine for games, but for editing code I want a normal monospace font rendered at a normal DPI.
- I feel like there should be a way to apply code changes without a full Publish. It's nice to test a change without resetting the entire world.
- Your docs are off to a good start, but it's really not clear to me how everything comes together. A more in depth example would be more helpful at this point than API docs, I think.
I'll definitely keep an eye on this. Nice work!
Thanks for the kind words!
See my demo at https://youtu.be/upg77dMBGDE. Version 0.1 will release with Mac and Windows binaries on Nov 6th.
Show HN: Enu – 3D Live Coding in Nim
You can use it without GC, but the new arc collector is suitable for hard real-time, so I don’t think there are many cases where you’d need to drop to manual management.
The main downsides (in my mind) are the small community and somewhat limited debugging support. I really like the language however, and use it wherever I can.
Perhaps the browser/OS vendors and Oracle could have worked together to make this happen, but they didn't, and the world moved on.