#compilerdev

2025-01-23

TIL that you can't perform an assignment in the second branch of a ternary operator because ternary has higher precedence than assignment.

On a related note, I'm pretty happy with how my toy C compiler reports errors now—it almost looks like GCC and Clang, at least for these simple cases.

#PLdev #compilerdev

A screenshot of C code.

```c
int main(void)
{
  int a = 2;
  int b = 1;
  a > b ? a = 1 : a = 0;
  return a;
}
```

When compile it with my toy C compiler, it produces the following error message:

```c
../../test_files/test.c:5:3: Error: expression is not assignable
```
The error message also includes a graphical indicator pointing to the source code position where error arises.
2024-11-28

Built my first lisp (after already having started writing two compilers xD) in #zig! Mainly to test out the language, but it was much fun anyway.

It also got a few ideas for my own language for a few functional programming things :D

I enoyied the most the memory checking zig does, be it leaks, use-after-free or double-free, which makes this project the most easy to be memory-safe out of all my native (c-like) projects whithout multiple days using #valgrind xD

#foss #oss #opensource #programming #langdev #lisp #coding #c #c++ #zig #functionalprograming #compilerdev

2024-10-01

Just released my attempt on reimplementing the dlang language with an modern codebase, focused on modularity & clearity of the code: codearq.net/mdc/mdc

Currently only the parser is implemented, which can completly parse the libphobos & its own source. Next steps would be to move the ast into it's own package (it's currently part of the parser), as well as implementing the semantic analysis, typechecker and IR.

#dlang #mdc #code #coding #programming #development #langdev #compilerdev

2024-05-12

Yay, I finally got the #dlang #parser to parse (without any exception or segfault) itself and the libphobos standard library! Next step is either start working on the IR or to increaset source-to-source compability to actually check if everything is parsed in a correct order and/or to enable usecases such as documentation tools and formatters.

Performancewise it's not that bad either; it parses all 314k lines of libphobos in ~5.5 seconds.

#dlang #compilerdev #langdev #PLDev #programming #programminglanguages #coding #development

Koning Van Worcester 👑️deavmi@ieji.de
2024-03-31

This post was automatically scheduled on the 27th of December at half-past midnight to post 3 months into 2024 - if this is here then it means I made proper progress with the T programming language compiler and I am now very happy about it.

#tlang #compilers #t #compilerdev

Does anyone have tools to be able to inspect a compiler's metadata (types, refinements, aliasing, uses/defs, etc.) about a program?

I've spent time today searching around for some syntax highlighter that can be used/extended to add metadata about each variable or function, such that the information displays when one hovers over the identifier. Similar to what IDEs offer, but with everything precomputed and done in-browser. I'm moderately baffled that I can't find anything.

I currently have my toy typechecker add inferred types and refinements back to the program source as comments, which is then dumped out, but I would imagine that someone probably would have considered better tooling for visualizing type checking and analysis passes in compilers before?

#compiler #compilers #compilerdev #CompilerConstruction

Xe :verified:cadey@pony.social
2022-12-31

I'm gonna stream tomorrow at noon EST! Gonna be writing a webassembly compiler as a part of modernizing hlang! It's gonna be a fun time writing the nguh (/ŋə/) hlang compiler and desperately hacking at things. Hopefully I don't go heckin' crazy!

If you don't make the stream, I'm gonna upload it to my YouTube feed and maybe my website if that works out. It may be too big for how I designed XeDN. We'll find out! It's probably fine.

#enVTuber #webassembly #hlang #compilerdev #vtuber #programming #stream

twitch.tv/princessxen

Becca Royal-Gordonbeccadax@queer.party
2022-11-20

I should write an #introduction, shouldn’t I?

Hi, I’m Becca. I’m a #poly #trans #lesbian with #ADHD in the #BayArea. I’m mildly kinky but keep horny off main.

I’m a programming language designer working on #SwiftLang’s Language Steering Group, and I do #compilerdev at #apple. I like teaching people to use things.

Outside of work, I play #FFXIV and I’m a #StarTrek fan (#DS9 is my fave). I’ve been getting back into #lego. I like reading—mostly web fiction, but occasionally novels—and I write #fanfiction occasionally. I’ve been exploring Taylor Swift’s catalog recently, but my music tastes usually run more to things like Coheed and Cambria or Dream Theater.

:anne_triangle: Anne C.A. BaanenVierkantor@mastodon.vierkantor.com
2022-11-20

Alright, the inliner succeeds on the entirety of the source code, time to push a new version of XukutOS!

Browse at: git.sr.ht/~vierkantor/XukutOS/

#osdev #compilerdev

Vegardvegard
2022-11-15

Picked up my toy language/compiler from years ago and am currently porting the old codebase from C++ to C. Feels weirdly therapeutic.

It never really got very far -- the most advanced program it could compile/run was a "generic" gcd() calculation. Maybe this time I'll get further?

:anne_triangle: Anne C.A. BaanenVierkantor@mastodon.vierkantor.com
2022-11-13

I think the inliner now works correctly given an infinitely fast computer and/or if we traverse the dependency graph perfectly! (Still have to fix that it becomes exponentially slow in the length of the dependency chain: inlining a function will add a note that it needs to be re-inlined if one of its dependencies changes, which means each time a dependency changes the number of notes doubles.)

#osdev #compilerdev

Joshua Barrettojsbarretto@social.coop
2022-10-28

I have departed #twitter. Any follow recommendations? #gamedev #rust #compilerdev

Brian Swetlandswetland@chaos.social
2022-06-14

Been thinking about my little systems language compiler project.

Goal: a simple language in the C/Go/Rust sphere with my favorite bits and a competent compiler that generates reasonable code (not horribly inefficient) that is predictable (avoid modern C/C++ UB time bombs and aggressive optimizations that make kernel/driver programming a misery).

Have made some decent progress but thinking it may be time to backup and adjust my approach.

github.com/swetland/compiler

#osdev #compilerdev

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst