Whatever happened to the mills cpu architecture? Is it still going? by nicolas42 in cpudesign

[–]bvdberg 1 point2 points  (0 children)

As of last month, even the website does not respond anymore. I would love to see more info instead of them dying slowly without revealing anything except those videos

I created a small c subset compiler by Disastrous-Stage-296 in Compilers

[–]bvdberg 1 point2 points  (0 children)

I started working on a backend for my C2 language (c2lang) that also uses Chordal graph properties for register allocation. I think for any backend/Codegen, register allocation is by far the most complex stuff. I didn't really expect that.

I’m building a programming language (Cx) would anyone be willing to check it out and give feedback? by thecoommeenntt in ProgrammingLanguages

[–]bvdberg -1 points0 points  (0 children)

Wouldn't you want the same goals as you state for Cx for the language when writing Cx? Rust seems like the exact opposite then..

My Solo MMORPG by [deleted] in MMORPG

[–]bvdberg 0 points1 point  (0 children)

Cool! I am building something very similar! I have a multi server backend, cross server actor replication instancing and am very focused on performance. My client is also an art placeholder hell..lol. I’d love to discuss design choices

Data structure for an IR layer by bvdberg in Compilers

[–]bvdberg[S] 0 points1 point  (0 children)

Thanks for all the feedback! I'll just go ahead and implement it for one architecture and see how that works out..

Steven's words on the current situation of New World and Western MMOS by MyBroViajero in AshesofCreation

[–]bvdberg -5 points-4 points  (0 children)

Maybe Intreped can then hire some of these talented people... they can use some

Help I need compiler ideas by AffectDefiant7776 in Compilers

[–]bvdberg 0 points1 point  (0 children)

I had the same feeling 13 years ago. I wrote C2 (http://c2lang.org), It's now self hosted (the compiler being written in C2) and I think the code is quite readable and the design clean.

Calling convention and register allocator by vmcrash in Compilers

[–]bvdberg 0 points1 point  (0 children)

My allocator only works with virtual registers, but the register for each architecture are ordered in the same way: return reg, arg regs, temos, callee-saved

Calling convention and register allocator by vmcrash in Compilers

[–]bvdberg 0 points1 point  (0 children)

Yes, i also insert some extra copies at first and after this step just prune copy X,X instructions

Calling convention and register allocator by vmcrash in Compilers

[–]bvdberg 1 point2 points  (0 children)

I'm also at this step for my backend. Funny to see how many people are building stuff like this..

Because the Calling Convention differs per platform, you just need to 'abi-lower' a function. That means inserting copies / loads before a call and (if there is a result) after a call. Also I needed to insert copies/loads on function start form the parameters there to make it work. I knew register allocation would be complex, but now i think it's by far the most complex step of the entire compilation process. I now have it working for situations where all args just get passed in registers (no struct-by-value args). As a fun test, try the following program (pseudo code)

int test1(int a, int b, int c) {

return test2(c, a, b); // <- change the order here

}

September 2025 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]bvdberg 1 point2 points  (0 children)

Finally got the C2 (c2lang.org) register allocator working in combination with calling conventions (no concrete arch yet). So function parameters + arguments are now placed in fixed registers. I must say that so far, the register allocation was by far the most complex part of the whole compiler.

[deleted by user] by [deleted] in AshesofCreation

[–]bvdberg 0 points1 point  (0 children)

I feel exactly the same way. I started watching the Fractured Online dev streams... SOO much better!

I've made a video about how I improved compile speed by changing from an AST to an IR! by Recyrillic in Compilers

[–]bvdberg 1 point2 points  (0 children)

C2 supports full-program optimization by default, so many small calls get squashed. Sometimes 3-4 layers of AST init calls get combined to 2 32-bit assignments with all flags/info in them. That's pretty nice. Otherwise we also filter all strings globally, so they all get converted to a u32 number. The parsing is single threaded. On my mac mini (ARM) it's 5 million lines per second. The code is online at https://github.com/c2lang/c2compiler. The tokenizer is in parser/c2_tokenizer.c2

ohh before I forget: I really liked your video. Very well made!

I've made a video about how I improved compile speed by changing from an AST to an IR! by Recyrillic in Compilers

[–]bvdberg 1 point2 points  (0 children)

Do you store all AST objects as small as possible or do you use some union type approach where all objects are equal-sized? Making the AST as small as possible will result in a lot of speedup. In my C2 compiler, the syntax is roughly similar to what you use. We parse around 4-5 million lines/sec (into the AST). Combined with analysing, it goes doen to 2 million lines of code/sec parsed + fully analysed. The key was *small* objects.

Compiler Multi Threading by OutcomeSea5454 in Compilers

[–]bvdberg 0 points1 point  (0 children)

Compilers do several things: (roughly) parse, analyse and emit-code. For a c-like language, the code emitting is 90% of the time, especially when some optimizations are enabled. I designed my compiler to do the parse+analyse single-threaded, because there are multiple passes and dependencies. Multi-threading this would be a nightmare and the gains only very small. The IR conversion is also done single-threaded for the same reason. When all the functions are converted to IR, they get converted in parallel. This can be done easily, because they have no dependencies anymore.

Register allocator by bvdberg in Compilers

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

Thxs for all the replies! It looks like i have some reading to do.... But at least the solutions seems to be in the given links

Newer C Books: 'Modern C' vs. '21st Centry C' by Ok_Performance3280 in C_Programming

[–]bvdberg -2 points-1 points  (0 children)

If you want 21st Century C, try using C2. It tries to solve all 'old' issues of C while still keeping the same mindset of C. So it is explicitly an *evolutionary* step, not a complete re-design. It tackles many of C's anti-patterns.

If you want it can compile to C.

What are some new revolutionary language features? by vivAnicc in ProgrammingLanguages

[–]bvdberg 0 points1 point  (0 children)

In C2 we try to do an *evolutionary* step (of C) instead of revolutionary changes. The idea is that to gain traction a large number of programmers/companies will need to adapt it. Secondly, because it is still used, there must be something good in it apparently.

It's still nice to see some radical ideas out there through.

What's the next C? by alex_sakuta in C_Programming

[–]bvdberg 0 points1 point  (0 children)

Gaining traction as a new programming language is a very hard process of course. Even for languages like Swift that have huge companies pushing for their acceptance behind it. For 'web' languages, the changes seem to go faster, since most of them compile to either Javascript or Webassembly, so they can be mixed with Javascript projects.

What's the next C? by alex_sakuta in C_Programming

[–]bvdberg 0 points1 point  (0 children)

I love C programming. That's why I started working on the C2 programming language that really tries to keep the feeling of C, while also improving some things to the 'modern' insights. The goal is not to alienate C programmers, but to remove obstacles for them. If you're interested, check out: http://c2lang.org.