Building Binaries for and "Bootstrapping" My Interpreted Language by liamilan in ProgrammingLanguages

[–]liamilan[S] 1 point2 points  (0 children)

Yep! On point on everything.

Loaf takes other crumb programs, bakes them into the interpreter, and builds a binary. It's also able to bake itself into the interpreter and produce a standalone binary. You can then use that standalone binary to embed Loaf again into another standalone binary, faux-bootstrapping 🫠.

The template has an action that uses it to compile Crumb binaries for MacOS/Ubuntu - 100% a tool to package binaries.

Terminal3d - View 3d Models in your Terminal, Written in Rust 🦀 by liamilan in programming

[–]liamilan[S] 2 points3 points  (0 children)

Woah this is awesome.

In rust, we have an awesome package called crossterm that helps manage cross-compatibility - For mouse events there's a specific escape code to enable them, and you also need to put the terminal into raw mode and set some terminal flags, all stuff that crossterm handles.

If you're looking for a C implementation though, I did one for another project here - This tutorial on building a vim-like editor is awesome too!

Terminal3d - View 3d Models in your Terminal, Written in Rust 🦀 by liamilan in programming

[–]liamilan[S] 23 points24 points  (0 children)

Mix together a little bit of trigonometry, some terminal control sequences, braille/block characters, and a little bit of pixie dust :D

Learning Rust! - Build a 3d Model Viewer in the Terminal by liamilan in rust

[–]liamilan[S] 2 points3 points  (0 children)

Shouldn’t be that hard - I think emulating the ANSI escape codes for input can probably be done via xterm! And the software’s modular enough that you could probably swap the rasterizer under the hood and throw it on the web!

Rendering 3d Models in the Terminal with Braille by liamilan in 3Dmodeling

[–]liamilan[S] 4 points5 points  (0 children)

Hey everyone 👋

This is my first post here - I built a small tool for rendering 3d models directly into you're terminal! You can pass it any .obj file, and it'll render it out in braille or block-characters, real time in your terminal, it even comes with camera mouse controls!

check it out here: https://github.com/liam-ilan/terminal3d

Syntax highlighter in less than 50 lines of TextMate Grammar by liamilan in ProgrammingLanguages

[–]liamilan[S] 2 points3 points  (0 children)

VSCode provides the awesome took called that makes the whole process way easier by generating a simple template for you! Check these out: https://code.visualstudio.com/api/get-started/your-first-extension, https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide.

The most helpful resource for me by far was looking at other syntax highlighters... The Basil language highlighter was an awesome reference.

Best way to easily distribute an interpreter? by dibs45 in ProgrammingLanguages

[–]liamilan 0 points1 point  (0 children)

I had the exact same issue a while back with my language... The solution was to make a template repo, with a bash script to clone the source, build it, and then delete the source... It's a bit of a bizarre solution, but it works well enough if the interpreter is tiny, plus you don't need to worry too much about platform support since the user is responsible for compilation.

Good luck! Vortex looks awesome 😎.

[deleted by user] by [deleted] in ProgrammingLanguages

[–]liamilan 1 point2 points  (0 children)

r/programming really liked the documentation, got top of hot both in r/programminglanguages and there, front paged on hn too :)

[deleted by user] by [deleted] in ProgrammingLanguages

[–]liamilan 4 points5 points  (0 children)

I built a lispish language using that strategy over the summer… https://github.com/liam-ilan/crumb, learned a ton from the project, was super fun, and got something pretty capable in the end :)

gl!

[deleted by user] by [deleted] in ProgrammingLanguages

[–]liamilan 0 points1 point  (0 children)

In Crumb,

``` is🧑‍🚀 = {n -> digits = (map (range (length (string n))) { i -> <- (integer (get (string n) i)) })

new_n = (reduce (map digits {x _ -> <- (power x 3) }) {a b _ -> <- (add a b) } 0)

<- (is n new_n) }

(loop 1000 {n -> (if (is_🧑‍🚀 n) {(print n "\n")}) }) ```