44 karma · joined Sep 27, 2021 (5y ago) · 25 submissions
comment 2y ago · link · parent
I used the language and VM to build a userspace for a custom operating system, writing a shell and a PowerPoint app. https://github.com/adam-mcdaniel/sage-os
I also built a web playground so you can compile and run the language in the browser, with JavaScript interop!! https://adam-mcdaniel.net/sage
comment 2y ago · link · parent
I made a video exploring my compiler for a language that targets a brainfuck-based VM: https://github.com/adam-mcdaniel/sage
I used the language and VM to build a userspace for a custom operating system, writing a shell and a PowerPoint app. https://github.com/adam-mcdaniel/sage-os
I also built a web playground so you can compile and run the language in the browser, with JavaScript interop!! https://adam-mcdaniel.net/sage
comment 2y ago · link · parent
Check out the web-demo to run the compiler in the browser, along with a graphical example using JavaScript interop! https://adam-mcdaniel.net/sage
Sage is designed to be portable, but also useful. To prove its usefulness, I used it to implement a user-space for a new operating system: SageOS https://github.com/adam-mcdaniel/sage-os The language also runs on embedded devices, like the flipper zero!
comment 2y ago · link · parent
Join the Discord to learn more about Sage! https://discord.gg/rSGkM4bcdP
Checkout the web-demo here! https://adam-mcdaniel.net/sage
comment 3y ago · link · parent
I decided to add pointer arithmetic because I needed a convenient way to interface with common existing constructs like allocators; I want to be able to hook my program up to valgrind and see what's wrong! But these pointer arithmetic operations are also generic across implementations: the web implementation uses tape indices as pointers (i.e. pointers with element sizes of 1), but the desktop implementation uses malloc/free and uses regular eight byte pointers. The compiler doesn't know the difference! This allows the architecture a large amount of flexibility across lots of different types of backend implementation!
Thanks for the feedback!
comment 3y ago · link · parent
Thanks for the feedback!
comment 3y ago · link · parent
comment 3y ago · link · parent
I think the Turing tape reflects Some Great Mathematical Truth®, but not any more than any other equivalent paradigm like lambda calculus. In truth, lambda calculus is much better and more elegant, but it would be much harder to compile down to target architectures directly unlike this Turing-tape-based solution. Most hardware implements at least one register that can index some large array of cells (RAM) and an accumulator; this is very easy to target using my architecture. I tried to come up with a model that could represent how we do computation on hardware well.
comment 3y ago · link · parent
I found it very simple to implement when I went to port it to the web in Rust and also when I wrote the implementation for the genetic algorithm in Python. You're right that it could be designed for better ease of use, but I was worried most about ease of compilation first and the capacity to express common programming paradigms second. Most of the ease-of-use stuff should be accomplished by the frontend language attached to the architecture.
Thanks for the feedback!!
18.
Compilers for the Future(adam-mcdaniel-blog.github.io ↗)
79 points · by adamthekiwi · 3y ago · 48 comments
19.
Harbor – A language that ports: examining the limits of compilation(github.com ↗)
1 points · by adamthekiwi · 4y ago · discuss
20.
Dune: A Shell by the Beach(github.com ↗)
3 points · by adamthekiwi · 5y ago · discuss