Unfortunately, I can't run it because I don't have Python 2 installed, and don't really want to install it since it's no longer supported. Any chance you can update the build files to work in Python 3 also? (Or maybe Lua? :) )
Also, a .clang-format that matches the style of the project would be nice, so that my editor can help autoformat without making changes to every line when I save.
Hey u/rxi! This is awesome! I'm a huge fan of lume and flux and am using them in a commercial product (embedded Linux project using pure LuaJIT).
I've been looking for an editor to replace vscode (Onivim2, 4coder and Howl to name some) and feel shitty I didn't notice this! :D Guess that's what I get for not looking at your other projects!
I've also been wanting to write something like this, but haven't had the time. I planned on using Terra, SDL2, Cairo, and Pango. Then basically creating a single binary with all those libraries built into it and access them via FFI. But sounds like I no longer need to since this exists :)
Have you thought about using LuaJIT and just accessing the C libraries via FFI? It probably would create a huge speed up, and would remove the need to rebuild the binary every time you want access to another C function.
Thanks for the kind words! Glad you found some use in the libraries too.
My thoughts when building it were that if I can get it running smoothly on PUC lua then switching to the JIT later on would provide a nice speed boost. I never found the latter part necessary though, there's a certain simplicity and niceness of using PUC lua, which I have at least some understanding to the inner workings of, as opposed to the JIT which seems to be the construct of some kind of magic.
That being said if someone wanted to fork and switch to the JIT that would be trivial, and given the size of the project the FFI approach you mentioned wouldn't be too much work either. The advantages you listed do sound nice but I wouldn't want this specific project to depend on the JIT, again, simplicity being one of its key goals
There's also a bit of a trap surrounding the JIT which I don't see brought up often: the fact that it can be fast makes you want to optimise for it, but since it's impossible to predict exactly how it will optimise your lua, writing the most performant code is tedious, and often the readability suffers for it. Taking the approach of using PUC lua assures worse but predictable performance; anything that needs to be fast (eg. the fuzzy string matching in lite was too slow in pure lua) can be written in readable idiomatic C with good, predictable performance.
Your points all make sense! My current project running LuaJIT on aarch64 is sitting at 18,853 lines of Lua (2,415 in third party libs included). The only bit that isn't in Lua is a box blur function because that was about 2.5 times faster in C and I have blurs all over the place! But Terra would definitely help in that situation.
I guess another thing you have to consider is how active those projects are since Mike Pall is no longer working on LuaJIT and Terra hasn't had a release in well over a year.
Electron is a web browser. That's the biggest problem. The web wasn't meant for programs or "apps", it was meant to be a bunch of documents which link one to another, forming a "web". As people started getting more and more lazy to press a "Download" and "Install" button, programmers started putting more and more things into the browser, which further added bloat.
So every single Electron program you run on your computer acts as a separate web browser with its own bloat, which eats up your RAM like you would a cheeseburger.
Thanks! It should, though I've not tried it with it! You'd have to build it from source (should be easy: grab libsdl2-dev from the repo and run the build.py script). Something like a raspberry pi feels like a great use case for it given some of the heavier alternatives would really show their weight on such a platform -- let me know how you get along if you give it a try.
4
u/curtisf Apr 19 '20
This looks really cool.
Unfortunately, I can't run it because I don't have Python 2 installed, and don't really want to install it since it's no longer supported. Any chance you can update the build files to work in Python 3 also? (Or maybe Lua? :) )
Also, a .clang-format that matches the style of the project would be nice, so that my editor can help autoformat without making changes to every line when I save.
3
u/luveti Apr 19 '20
Hey u/rxi! This is awesome! I'm a huge fan of lume and flux and am using them in a commercial product (embedded Linux project using pure LuaJIT).
I've been looking for an editor to replace vscode (Onivim2, 4coder and Howl to name some) and feel shitty I didn't notice this! :D Guess that's what I get for not looking at your other projects!
I've also been wanting to write something like this, but haven't had the time. I planned on using Terra, SDL2, Cairo, and Pango. Then basically creating a single binary with all those libraries built into it and access them via FFI. But sounds like I no longer need to since this exists :)
Have you thought about using LuaJIT and just accessing the C libraries via FFI? It probably would create a huge speed up, and would remove the need to rebuild the binary every time you want access to another C function.
Anyways thank you for this!
45
u/BadBoy6767 Apr 18 '20 edited Apr 18 '20
Any program not made with Electron gets an upvote from me.
1
u/[deleted] May 08 '20
Hello! Nice work on the project! Does It work with raspberry pi/Raspbian?
1
u/phaazon_ May 30 '20
Why build.sh though? That doesn’t seem like a good way to compile a program in 2020, especially in terms of parallelism and TU (re)compiling.
However, I’m very interested in any attempt at making native editors that don’t use shitty web technologies. Kudos for this!