6 ms·
Bram Moolenaar's programming language, Zimbu
- max_ 3y agoI am not a user of Vim, but this guy used the "charity ware" model to do so much inspiring work in Uganda (my country).[0] I hope I will be able to do something close to his achievements in my lifetime. [0]: https://en.wikipedia.org/wiki/Bram_Moolenaar https://en.wikipedia.org/wiki/Bram_Moolenaar
- gowld 3y agoQuite a contrast from Vim's infamous internal language for plugins.
- krossitalk 3y agoSo...he invented Python?
- noaoh 3y agoLast working version of the homepage from the Internet Archive: https://web.archive.org/web/20230529224014/http://www.zimbu.org/ https://web.archive.org/web/20230529224014/http://www.zimbu..... Tried a couple of link, they seem to work.
- noaoh 3y agoUpdate: I was able to find the mercurial repo on https://bitbucket-archive.softwareheritage.org/projects/zi/zimbu/zimbu.html https://bitbucket-archive.softwareheritage.org/projects/zi/z..., looks like it hadn't been updated since 2016.
- finnh 3y agoOdd that the first example looks buggy: while i > size result += a [i++] } Could be correct, but "while i < size" seems more likely...
- User3456335 3y ago> Zimbu’s trademark feature was the way it let coders omit the opening curly brace around a block of code. (“It looks a bit weird maybe, at first…” Moolenaar acknowledged to the audience. “Get used to it. It will work out fine.”) Hahahaha, this is what we needed: a programming language with unmatched braces because the opening brace can be inferred from context... Well, no surprise that this is coming from the Vim creator.
- sph 3y agoNot that dumb as one might think. What is the purpose of the opening brace after a function declaration in C, for example? It's the only token accepted, so its sole purpose is symmetry with the closing brace, which has an actual purpose. So it might look silly, but there is no deep reason it couldn't have just been int main() printf("hello"); } That's just as unambiguous to parse.
- vore 3y agoNot in the original C, where you had to declare function parameter types like so: int foo(x) int x; { return x; } and not in C23 (or GNU C) either, where this is legal (this example is not super useful): int foo(int x) [[gnu::aligned]] { return x; }
- mikepavone 3y agoTechnically, the opening brace is needed in C to support K&R style function declarations which apparently were still legal in C11 at least, but I doubt that's a feature anyone wants to replicate in a new language.
- layer8 3y agoIn that case, I would prefer Pascal’s (and Basic’s) “end”, however.
- zarzavat 3y agoUnmatched braces completely mess up text editors, which would need to include a full parser in order to pair-match brackets (it also creates an unresolved tension that will stay with you all day :)
- Smaug123 3y agoEDIT: of course, moments after I submitted this comment, I found the following in the spec: "For more flexibility, at the cost of performance and causing mistakes to be discovered only when the program is being executed, the dyn type can be used. A variable of this type can contain any kind of value or reference. Assignment to a dyn variable never fails. However, using the variable where a specific type is expected will invoke a runtime type check. For this purpose the dyn type stores information about the actual type." Original comment below for posterity. ---- The article claims that Zimbu has "both static and dynamic typing", which sounds novel and interesting to me. But on the Zimbu site linked by a sibling, all I could find (on https://web.archive.org/web/20230529230025/http://www.zimbu.org/design/goals https://web.archive.org/web/20230529230025/http://www.zimbu....) was: > It should work to have as much static type checking as possible, but make it possible to have dynamic types with runtime type checking. Can anyone find any more details about this feature? (Or does it just mean "there's a type `obj` which is a supertype of every type", which is much less interesting except insofar as it interacts with what it means for something to be a reference vs value type?) The spec at https://web.archive.org/web/20230805135331/https://www.moolenaar.net/z/zimbu/spec/zimbu.html https://web.archive.org/web/20230805135331/https://www.moole... is awfully long.
- thechao 3y agoSounds like gradual typing, maybe? That stuff was hot, years ago. Jeremy Siek is one the original inventors — his stuff is really approachable.
- Jtsummers 3y agoI suspect an autoincorrect incident. Jeremy Siek, he also has a couple compiler books out now (basically the same book, one with Python and one with Racket). https://wphomes.soic.indiana.edu/jsiek/ https://wphomes.soic.indiana.edu/jsiek/ Essentials of Compilation, both versions have a chapter on gradual typing.
- mikl 3y agoOther than VimScript and Vim9Script, of course.
- whatscooking 3y agoUgly programming language. I don’t know who would use it
- justinpombrio 3y agoFor anyone else that wants to just skip to the language spec: https://www.moolenaar.net/z/zimbu/spec/zimbu.html https://www.moolenaar.net/z/zimbu/spec/zimbu.html
- jhoechtl 3y agoI see a lot of similarities to Golang.
- _a_a_a_ 3y agoint main() printf("hello"); } This is perfectly reasonable and has precedent in one of Wirth's languages (modular 3? Oberon?): /* Syntax from memory, may be wrong */ function main(): integer println("hello"); end; This does potentially break a symmetry in the language as to how a begin…End / {...} local block can be declared, but whatever, that's easily fixed. I don't see how this would make any particular issue for bracket matching (except one of the brackets isn't there, you match to something else such as the start of the function) and lexing/parsing is fast. Just as a suggestion buy if everybody here actually write their own compiler, even a simple one, perhaps there would be less bikeshedding.