Latest posts tagged with #pldev on Bluesky
Do you ever wake up and think? "wouldn't it be fun to make a sample player for the #PlayDate console in your own programming language?" #PLDev #badlang
Is there are a working _interactive_ low-level Language Server Protocol client anywhere?
I'm very specifically looking to poke at an existing implementation to see how it works in context, not make my own (plenty of tooling for that, somehow!)
:boost_requested:
#programming #pldev
I did a short survey of #compiler backends: abhinavsarkar.net/notes/2025-compiler-back...
#compilers #programming #pldev #langdev #blogging
I’m tempted to write my programming language with a simplified ohm grammar engine, so that you can extend the language directly.
ohmjs.org/docs/syntax-...
#PLdev #KonaScript
After several rewrite, and the implementation of a typed AST (instead of having to evaluate any expression at least twice), I added imports (or "remixes") of Miku lang files. I need to think about other languages (i.e. C lib for instance) now #PLDev
Just one more compiler...
I've made a language based on music (because Hatsune Miku) but it's basically Java in a trench coat.
and I've implemented enough to be able to write small programs. #PLDev gist.github.com/minirop/061a...
I started working on a small programming language that compiles to Lua so that I can work on a Play date game.
I didn’t have to start from scratch! I had written quite a bit las year when working on Kona. #PLdev
New Bismuth VM blog post, detailing the life cycle of a hello world program for Bismuth from high level Bronze code to text-based IR, transpiled C, binary IR, and finally bytecode: enikofox.com/posts/hello-...
#BismuthVM #PLDev
pin hsource as psource { pin hdest as pdest { while unsigned(height > 0) { let srcend = srcoff + widthMinusOne; while unsigned(srcoff <= srcend) { let v = ploadu8(psource, srcoff); if v: pstorei8(pdest, destoff, v); srcoff = srcoff + 1; destoff = destoff + 1; } srcoff = srcoff + srcstep; destoff = destoff + deststep; height = height - 1; } } }
now that handle pinning is implemented in my VM i can use it to speed up my VM's blit routine
this is Bronze code, which is converted to my VM's intermediate representation, which is then transpiled to C so i can integrate it into my VM :3
and now the core of my VM is finally done! \o/
#PLDev
VM development update: I have done a bunch of rewriting to make things more secure and also have now paved the way for types larger than 32 bits
#PLDev
suppose i should do an update here on my VM. it now has try/catch/finally with a fixed format for exception objects which are automatically freed when leaving the catch block
if i can get handle locking/pinning in so i can have direct safe access to pointers i will consider the core done
#PLDev
geordi laforge nah yea meme saying nah: creating new programming languages because it's fun and interesting yea: creating new programming languages so LLM's won't know how to use them
If you're getting into #PLDev and writing parsers the first thing you should know is that doing everything in a single pass is fucking hard. Parsing an AST and Doing multiple passes over that (resolving symbols, guaranteeing return values, type checking) is like a bazillion times easier
thinking about my #PLDev project. i was gonna make it like C, but now i'm thinking since i have a reusable IR and VM so multiple languages can easily target it, maybe my first language should hew closely to the actual IR?
so i can write "raw" IR but without the lots of parentheses of s-expressions
making good progress on my parser, and now i'm thinking of committing some crimes >:3
that being having both `and` and `&&`, and `or` and `||`, where the latter coerces to bool and the former does not and acts like lua >_>
#PLDev
expression !(5 - 4 > 3 * 2 == !true) parsed with proper precedence
okay, got basic expressions going. a little slower going than i'd like since i'm adapting the crafting interpreters code to C# and building an AST of nodes instead of emitting single pass bytecode
#PLDev
For my next #compiler project, I want to write the optimization passes myself, but I don't want to deal with generating machine code for multiple platforms. So tell me #programminglanguages #plt #compilers fedi, what is an IR that I can target that has a non-optimizing compiler to machine code […]
My programming language *Xenon* now has a website!
xenonlanguage.github.io
Check it out!
#programming #website #xenon #language #pldev #hashtag #okillstop
Badlang code with some conditional expression and the linear IR it produces.
Work continues on the self-hosted implementation. A good chunk of the typechecking is done and am currently working on compilation to a linear IR that uses different basic blocks per function but is not on an SSA form. Trying to keep things simple for now.
#PLDev #Badlang
Small snippet of code of my simple lisp language: (let x 1) (print (switch x (case 0 "hello") (case 1 "world") "nobody" ))
Assembly generated from the previous code (without the .data section): .text .globl main main: pushq %rbp movq %rsp, %rbp movl $1, x(%rip) movq str1(%rip), %rsi leaq str3(%rip), %rdi movl $0, %eax callq printf movl $0, %eax leave ret
I decided to give QBE (c9x.me/compile/) a shot for real and as a small codegen backend it's nice. This is a small code that compiles and the generated assembly. #PLDev #compiler
AST of the self-hosted implementation of a parser and the code that generates it
My self-hosted parser can now fully parse itself
#PLDev #badlang
badlang code and the equivalent AST representation, where multiple nodes are connected with nice looking arrows.
Still lots to do, but the self-hosted parser is shaping up!
#pldev #badlang
a couple of expressions on a badlang program alongside the AST it generates, visualized with graphviz
A while ago I saw some amazing threads by @katef.bsky.social on "The Bad Place" where they advocated for printing the internal state of your compiler with graphviz. I was very impressed and been ever since trying to incorporate it in my work. It's back now on the self-hosted compiler #badlang #PLDev
I have imports on my language... I may have gotten a bit ahead of myself and ported most of Raylib's binding by hand... Definitely better to write some scripts for porting bindings in the future lol.
git.badd10de.dev/bdl/tree/exa...
#PLDev #badlang
Got far enough on my compiler today to be able to write the game of life using raylib. I'm so excited to be able to just link to libraylib.a and have this work without any other dependencies (the magic of compiling to C!). thanks @raysan5.bsky.social for making this amazing library!
#PLDev #badlang
badlang code for rule110 along with its output
We've have Turing completeness on the the C backend, exciting times!
#PLDev #Badlang
choice Result :: T { Ok: T Err } match Result::(Str).Ok("hello") { Ok(x) = x Err = "error!" } match Result::(Int).Ok(123) { Ok(x) = x Err = 4 } choice Either :: (A B) { Left: A Right: B } match Either::(Int S8).Left(123) { Left(x) = x Right(y) = y }
Polymorphic sum types? yes please! time to move on to codegen :)
#PLDev
some badlang code and the resulting type table: struct Single :: T { x: T y: Int } ; let err: Single ; This should fail, polymorphic type is not qualified. let s0: Single::Int s0 s0.x ; set s0.x = "hi" ; fails set s0.x = 10 ; succeeds let s1: Single::F64 s1 s1.x set s1.x = 2.0 ; succeeds struct Tuple :: (L R) { left: L right: R } let t0: Tuple::(Int Str) t0 t0.left t0.right let t1: Tuple::(F32 S8) t1 t1.left t1.right
I'm also working on my own programming language (badlang), today I did a first implementation of typechecking for polymorphic struct/union types
#PLDev