14 hours ago

The #rust byte code #compiler / #VM, I am putting together for my adventure games now has variable!

Command line output:
Luny's Adventure Scenario Compiler

> var a=24; var b=6; print a+b;
Club de TéléMatique :verified:
3 days ago

Portable C compiler: a C99 compiler while still keeping it small, simple, fast and understandable: #free #compiler #C99

heise Developer
1 week ago

Compiler-Duo: Viele Verbesserungen für Clang 17 und LLVM 17

Neben einer Fülle an Details und Korrekturen verstärkt die neue Compiler-Generation von Clang und LLVM 17 die Sprachen C++20, C++23 und C++26.

#Compiler #LinuxundOpenSource #Programmierung #Softwareentwicklung #news

C++ Code
1 week ago

The Odd operator is beautifully easy after Inc and Dec. I've highlighted to two instructions for the Odd itself and the CPL for NOT. Ignore the references to temp0 which will get optimised away at some point.

Note how the allocator is smart enough to only load the low byte of the 16-bit variable.

I think I'll also add a version that targets a branch. It'll be a lot shorter if optimised.

#compiler #pascal #z80 #quiche

var a:=101
var b:=not odd(a)


;1: var a:=101
                     ;Prim: assignoffset16imm8
  ld (ix-$02),$65	;a
  ld (ix-$01),$00
;2: var b:=not odd(a)
  ld a,(ix-$02)	;a
                     ;Prim: odd8r
  sbc a,a
  ld (ix-$03),a	;=temp0
  ld a,(ix-$03)	;=temp0
                     ;Prim: cpla
  ld (ix-$04),a	;b

1 week ago

Almost all the code generation is table driven. Inc and Dec are one of the exceptions that require code. In this case it's a loop to generate the INC or DEC instructions.

Only thing left to do is to generate add or subtract if the offset is too large. For now I'm stabbing at doing this for offset greater than four. Optimising here is much more complex than it might seem. For example you can INC any register whereas ADD requires A.

#compiler #z80 #pascal

The source code inc(a, 4) generates four four INC HL opcodes.
1 week ago

I'm working my way through 'intrinsics' in the #compiler. These are operations that look like functions or procedures to the programmer but are generated inline code. Examples are Write, Inc, Peek, Poke, Inp, Out, Sizeof and High.

Support for these includes adding an 'Enumerable' type set for the parameters and some flags. Inc and Dec can only accept a variable reference as the first parameter and a constant as the optional second parameter.

#z80 #pascal #quiche

The operator table for Inc and Dec. The first parameter type is given as Enumerable. The flags column lists 'p2optional;p1variable;p2immediate'
blake shaw
1 week ago

@lightning I just looked it up and #PCC is... 1mb. PCC wins smallest efficient #compiler infrastructure by a landslide, wow.

2 weeks ago

I've spent the day upgrading the error reporting in the #compiler. Previously it used simple error codes. It's been bugging me that I can't add more detailed messages, or include extra data such as a type name or variable name.

So here it is reporting the actual variable name it has an issue with.

var a:=1

Raises error:
Variable not found: 'b' at line 2 2
3 weeks ago

I should write a #ruby #compiler in #llvm

Disaster Autist
3 weeks ago

@cfbolz Just for those who don’t get the joke: It’s a play on #compiler explorer

4 weeks ago

I'm adding typecasts to the #Quiche #compiler. This is the next step toward full function support. In #Pascal typecast syntax is the same as a function.

b := integer(a);

This gives me the hooks I need to call functions within expressions and handle the return value. But typecasts generate inline code so I don't have to do stack frames yet.


I know I posted already about this, but let me #gloat.

I started working on #Squarepants 3 years ago, when I didn't have a clue of how to write a #compiler.

When I finally managed to make the first version run (it was written in #elm ) it took seven minutes to compile.

Now it takes less than four seconds.

Fuck yeah.

This is so satisfying. _^

1 month ago

Is there a compiled programming language with a Python-like syntax?

#compiler #programminglanguages #programming #Python

Adrian Lopez
1 month ago

#Compiler.nvim now support all the #programming #languages that were originally planned. That is:

* 22 programming languages
* 128 different ways of compiling
* 128 unit tests
* 100+ examples
* 1 test suite

Through the lapse of 75 days. That's... A lot of coding.

Adrian Lopez
1 month ago

The #zig language is actually very cool. Its compiler has many aspects of #rust like:

* The #compiler knows how to find all the files of the programs just by passing it the entry point file. This makes unnecessary using a building system in most instances.
* more intelligent errors messages.

I'm just adding support for it to the #neovim #plugin compiler.nvim

Jan :rust: :ferris:
1 month ago

This is mad 🤯

oxc - The Oxidation #Compiler is creating a suite of high-#performance tools for the #JavaScript / #TypeScript language re-written in #Rust - by Boshen:

It's linter is 50 - 100 times faster than #ESLint...

...and its parser is even 2x faster than #swc

#JS tooling goes brrrrrrrrrrr! 🚀

#RustLang #WebDev #WebDevelopment

1 month ago

Does anyone have any good #resources on learning #codegeneration?
I feel like everywhere I look for #compiler building resources it's just the trivial parsing and lexing parts

#programming #programminglanguages

1 month ago

The Rust #compiler is, of course, written in #Rust.

How do you compile it?

Hobson Lane
1 month ago

Anyone forming a team for this OSSF funded competition (2 yr $20M in prizes)?

Teams will need #NLP, #CyberSecurity, #StaticAnalysis and #Compiler expertise. Maybe #OpenSource project and community management experience would help too. This will likely hinge on #GOFAI algorithms like A* search, and graph querying (#AST walking). If you've written a linter you probably have the right stuff.

1 month ago

(Yes, for any other #compiler nerds in the audience, the goal is to fully self-host the SwitchBoard recipe technology.)

Marco Ivaldi
1 month ago

The Secret Life of C++: What Your #Compiler Doesn't Want You To Know

#CPP is filled with strange and wonderful features, with a few more added in C++11. We will explore in detail how these features are implemented under the covers, in terms of the #assembly #code generated.”

1 month ago

In the test code I added a routine to store written characters to a buffer round robin buffer.

I can pull out the buffer data from the memory dump after emulation.

#z80 #compiler #Quiche #pascal #delphi

var c:Char
  for c:='a' to 'z' do
    write(c,' ')


Write Buffer:
a b c d e f g h i j k l m n o p q r s t u v w x y z
1 month ago

After a days thrashing in Delphi the #Quiche #compiler can now generate calls to Write and WriteLn.

Being able to make function calls has been my target for several months so it feel great to finally arrive.

Having said that, Write and WriteLn are special cases that sidestep a few steps required for full function calling. but I'm getting close now.

Source code:

Object code:

;2: write('x')
  ld a,$78
;Gen: :write_char
  call write_char

2 months ago

#EXP :
Le podcast #CosyCorner.
Du #RPG, du jeu vidéo, des sketchs, du small talk et autres avec Medoc et @Moguri.

#TempsReel, #Compiler :
Via le compte de @fenarinarsa quelques messages sur la #demoscene et de la technique (plutôt sur des machines rétro).

2 months ago

Have you decompiled #code to see how the #compiler has organized your code?


2 months ago

I've spent the last week working on comparison operators in the #Quiche #Z80 #compiler. These either result in a branch or an assignment.

Branching is easy - just use the CPU flags. Assignment means converting to $00 or $ff (false or true).

Carry flag to boolean is just SBC A,A. If carry set we get -1 ($ff). If carry clear we get 0. To invert we can CCF (invert carry flag) before or CPL (bitwise invert A) after. 1/n

Tim Morgan
2 months ago

Hello friends, I recorded my first video in like 8 months! In this one we add the start of an LLVM JIT for our statically-typed compiler. 🟥💎🤓

#ruby #compiler #video #jit #llvm

2 months ago

‘Computer language that anyone can read’ launches Aeternity compiler - Lexon now features a compiler that allows users to translate code... - #smartcontracts #aeternity #compiler #lexon

Ivan Enderlin 🦀
2 months ago

Optimizing Rust programs with PGO and BOLT using cargo-pgo,

Feedback-directed optimisations made easy with `cargo-pgo`! Neat.

#RustLang #compiler #performance #PGO #BOLT #LLVM

Markus Osterhoff
2 months ago

Schönen guten Morgen!

Bin dabei, unseren zentralen Steuerrechner am #Röntgen-#Mikroskop neu aufzusetzen. Das System an sich läuft, nur die Steuersoftware nicht. Also, die Software schon, und sie steuert auch, sogar unser Mikroskop.

Aber wir hijacken noch eine ganze #Beamline, und die Kommunikation dahin ist tot.

Später mal analysieren, *wo* das Problem liegt:
omniORB, Tango, C-Bindings, SPEC …
oder eine ungünstige #Compiler-Version …

Jetzt aber erstmal #Frühstück ☕.

Habt einen schönen Tag!

Popeye Otaku
2 months ago

Arenas are super funny to me; folks suddinly rediscovering that array index operations are summa the most well studied and powerful #compiler optimizations out there

*Almos all* of the origimal #FORTRAN compiler from the 50s was around doing this!! (they actually considered normalous expressions trivial to codegen for, parsing 'em was harder)

Michael T Babcock
2 months ago

@Angle @ddevine it would be fun to be able to feed the output from something like gprof into the compiler so it knows how the code paths are actually *used* and then let it do a better optimization as a result.
#compiler #optimization #coding #softwareDevelopment

Michael T Babcock
2 months ago

@Angle my problem is that I'm not convinced "readability" is a teachable concept for a #compiler / #algorithm without doing it the hard (analyse samples, generate model) way. YMMV and maybe someone will do it in code, but it *feels* like the kind of problem humans are just more suited to than computers in the first place. Much like map route solving.
#programming #brainstorm

Popeye Otaku
2 months ago

the weird thin about all me #compiler stuff over the last couple years is I cain't hardly use a language unless I've skimmed thru its offisal for-compiler-devs-only spec 🤔🤔🤔🤔🤔

Ivan Enderlin 🦀
2 months ago

Progress report on rustc_codegen_cranelift (July 2023),

The goal of this project is to create an alternative codegen backend for the Rust compiler based on Cranelift. This is a progress report of the project.

#RustLang #cranelift #compiler

Andrew Tropin
2 months ago

A book on compilers. Free for personal use:

I would also like to share Compiling with Continuations, but it's not free available.

#book #books #compiler #compilers #llvm #gcc

2 months ago

It's surprising how many different ways to break a compiler you can find in just 3 lines of code

#programmingLanguages #languageImplementation #compiler

Ivan Enderlin 🦀
3 months ago

Speculation in JavaScriptCore,

A long blog post explaining in details what a speculative compiler is, and how it is implemented in JavaScriptCore, the JavaScript engine of WebKit.

#compiler #JavaScript #performance #speculation

Optionally, if I have enough time and it proves to be really useful: use #symbolic #execution to determine if #decompiled code corresponds to original sources code. It doesn't look trivial at all, as codes written by humans tends to be much more verbose, logical, etc, than codes generated by compilers.

In summary: it's hard to compare, say, humans written Abstract Syntax Trees against the #AST given by an optimising #decompiler taking as input code optimised by a #compiler.

Dr. Brian Callahan
3 months ago

A new #blog post appears!

Installing Oracle Developer Studio 12.6 on OpenIndiana, a tale of lies.

Join me as I install Oracle's proprietary compiler suite on an open source Illumos distro, despite Oracle's best attempts to stop me.

#programming #compiler #compilers #solaris #sun #oracle #c #linux #freebsd #openbsd #netbsd #dragonflybsd #bsd #unix #illumos #openindiana #opensolaris

Luc Tielen
3 months ago

Been a while since I posted here, but life has been super busy lately.

But today I'm happy to announce the first version of the eclair website: !

#programming #datalog #compiler

For the #GPU and #compiler folks, looks like the Arm Norway Mali (formerly Falanx) team is recruiting people to work on the Mali GPU and its compiler toolchain. But it seems there are more roles available as well.

Location: Trondheim, Norway

Possibly interesting for some #GameDev folks as well.

3 months ago
3 months ago

The two hardest problems in #compiler development:

1. Escape analysis
2. Lexing float and string constants

DansLeRuSH ᴱᶰ
3 months ago

#CLanguage « #SectorC is a #C #compiler written in x86-16 assembly that fits within the 512 byte boot sector of an x86 machine. It supports a subset of C that is large enough to write real and interesting programs. It is quite likely the smallest C compiler ever written. »

Marco Ivaldi
4 months ago

#SectorC: A #C #Compiler in 512 bytes

“Big Insight #2 is that atoi() behaves as a (bad) hash function on ordinary text. It consumes characters and updates a 16-bit integer. Hashes are perhaps the holy-grail of computer-science. With a good hash, we can just side-step all the hard problems by trading them for an even harder problem (hash collisions), and then we just ignore that harder problem. Brilliant. (sticks fingers in ears) 🤪”

4 months ago

Nice free course by Cornell university for learning a couple of things about compilers and programming languages implementations

Github repo:

#infosec #cybersecurity #compiler

blake shaw
4 months ago

'As I can attest from personal experience, having a #compiler leads to hubris: you start to consider source languages like a hungry person looks at a restaurant menu. "Wouldn't it be nice to ingest that?" That's what we say at restaurants, right, fellow humans?'

from the latest @wingo/log

Phil Eaton
4 months ago

It's an unfortunate meme IMO that tech Reddit is low-quality. You just have to find interesting subreddits!

I've updated my list for 2023.

#compiler #database #distributedsystems

5 months ago

#Development #Reviews
The JavaScript ecosystem is delightfully weird · The many ways people aren’t writing JavaScript anymore

“The JavaScript you write not only isn’t the JavaScript you run, but under closer examination, it isn’t even JavaScript at all.” —Sam Ruby

#WebDevelopment #WebDev #Frontend #Backend #EcmaScript #JavaScript #Ecosystem #Framework #Library #Compiler #Bundler

I've revisited my #ruby #compiler for the first time in probably a couple of years (with far longer since I wrote an article) and implemented type tagging for integers. Amazingly it took only a couple of hours, and it reduces the memory allocation pressure dramatically to the point where I'm now tempted to try to fix the remaining bugs preventing it from being fully self-hosted and doing some work on it again...

Ivan Enderlin 🦀
5 months ago

Wasmer 3.3 - Running WebAssembly 2.5x faster with JavascriptCore,

Wasmer 3.3 has a new backend which uses JavaScriptCore. Interesting approach. It’s the 4th backend after SinglePass, Cranelift and LLVM.

Wasmer is still a great project but its CEO is a danger. Reminder: Its toxic behaviour is still very present.

But the project is great. Thanks to the contributors and the brave employees working there!

#WebAssembly #compiler #runtime #RustLang

Jan :rust: :ferris:
5 months ago

It's alive!🎉

I've built a #transpiler in #Rust, compiled it to #WASM and integrated it into a #Vue app! :awesome:

It's called selecuery.✨

It can transpile X++ select statements into query expressions. If you think "X++" is a typo and you don't have any idea of what I'm talking about, don't worry.😄

Have a look at the video below.

This project is dear to my heart! ❤️ I've started it 2019 for learning #RustLang.

I think, I've been transpiled during this project as well.🤪

#Compiler #Magic

A video showing a web app with two code editors side-by-side.
On the left, source code is entered, which looks like an SQL dialect. As the code is entered on the left, the code editor on the right updates in real-time. The right editor shows the SQL-like statement in a very different form, namely as a sequence of method calls on a query object.

So it has just transpiled a declarative SQL-like statement into a procedural query expression.

You can think of it a bit like C#'s LINQ: LINQ also has a declarative form and a procedural form.
Jan :rust: :ferris:
5 months ago

If you thought #TypeScript had a crazy #TypeSystem then you probably haven't heard of #Ezno yet (by kaleidawave):

Introducing Ezno:

"In short, it is a #JavaScript #compiler featuring checking, #correctness and #performance for building full-stack (rendering on the client and server) websites."

Ezno in '23:

This type system is craaaazyyy!🤪

Can't wait for 1.0! :awesome: 🚀

#ProgrammingLanguage #WebDev

Jan :rust: :ferris:
5 months ago

Inventing software that can "understand" context-dependent, ambiguous natural language, so that we can let it generate software with a context-free, unambiguous language. ➰

What can go wrong!? :awesome:

#AI #ArtificialIntelligence #ChatGPT #LLM #SALAMI #ContextFree #ProgrammingLanguage #Compiler

6 months ago

Doing some work on a #Lisp #Compiler and, aaargh ... got one of those problems when the compiler, interpreted, can compile itself. The compiled compiler can again compile itself. That twice compiled compiler hits an error compiling itself a third time. Fun ...

Barry Schwartz 🫖
6 months ago

This #compiler for the #RosettaCode Virtual Machine assembly language can now target any of #ATS, #C, #Mercury, or #Scheme --

The Scheme code runs very fast in #ChezScheme, so-so in all else I have tried. I wonder how they do it. Maybe a lot of C code (instead of Scheme) in the runtime is part of it?

The generated Mercury is not so fast, but such is life with Mercury. It’s fastish, considering.

#ATSlang #ContinuationPassingStyle #FunctionalProgramming

Barry Schwartz 🫖
6 months ago

I decided to keep going and have added "vmc", the virtual machine compiler:

No guarantee it works at any given time--though, if I am good, I can work with Mercurial branches. Right now it can compile to #ATS and to #C

#Compiler #FunctionalProgramming #ATSlang

The ATS it makes does tail calls. The C uses goto--many more goto than are needed, but optimizers might clean that out. The generated code is in continuation-passing style.

Barry Schwartz 🫖
6 months ago

I went ahead and wrote a Virtual Machine to #ATS translator for the #RosettaCode #compiler task series:

Compiler/virtual machine interpreter - Rosetta Code

The thing’s designed to make it relatively easy to handle many other languages. Languages with #goto should be easy to do, for instance: convert the program to one procedure with a lot of goto in it. And #Scheme could be done easily. I have ideas for #ObjectIcon and co-expressions.


Matthew Slowe
6 months ago

@Edent it may not be closed any more but #SunMicrosystem's #C #Compiler was a closed-source thing #cc (now #Oracle Developer Studio so chances of being #opensource are slim!

7 months ago

#Development #Overviews
The most popular build tools for front-end developers in 2023 · Key features and benefits of the top build tools for web development

#WebDevelopment #WebDev #Frontend #Workflow #Collaboration #Automation #Tool #BuildTool #Compiler #Bundler #TaskRunner #JavaScript #TypeScript #Esbuild #Lerna #Nx #Parcel #Rollup #Rome #SWC #Turbo #Vite #Webpack

Benjamin Bouvier 🍔
8 months ago

I've been contacted by someone who's looking for a mentor in the #compiler area. They're new to compiler design, but they do seem very interested and they've taken a sabbatical to learn about it.

Is someone around here interested to become their mentor?

Boosts appreciated 🙏

Dr. Brian Callahan
9 months ago

A wild #blog post appeared!

Did you know that #GCC just added Modula-2 and #Rust frontends to mainline? Come with me as I explore how well they work on #OpenBSD. (Spoiler: excellently out-of-the-box.)

As an added bonus, there are instructions in the blog post for how you can get your own GCC with Modula-2 and Rust on your own OpenBSD machine. Just a quick pkg_add away!

#compiler #compilers #opensource #freesoftware #FOSS #FLOSS #OSS #FreeBSD #NetBSD #DragonFlyBSD #BSD #Unix #Linux

Luc Tielen
9 months ago

Upgraded dead code elimination algorithm for eclair.

Really satisfying to see how much the new algorithm can throw away.

#compiler #datalog

Jordan Eldredge
9 months ago

Been spending some time in my evenings hacking on a TypeScript library to make it easy to build Wasm modules directly in the browser without needing to muck about with the binary encoding.

Could be useful for defining little DSLs that get compiled to Wasm and run directly in the user's browser.

#wasm #compiler

Nuke the C++ implementation of Zig from orbit using WASI,

> The idea is to use a small WASI binary as a stage1 kernel that is committed to source control and therefore can be used to build any commit from source. We provide a minimal WASI interpreter implementation that is built from C source, and then used to translate the Zig self-hosted compiler source code into C code.

#ZigLang #WebAssembly #wasm #wasi #compiler

10 months ago

#Compiler: Okay, so I’m gonna need you to add these numbers and then multiply these numbers.

CPU: You’re saying you want me to…load an effective address?

matt 🦕
10 months ago

I never thought to actually look into "what the #compiler actually does" and just took it as one of the difficult things that I didn't really need to understand.

However, given that I'm now spending more time with #Rust I figured it might be useful to actually take a closer look.

This excellent video is focussed on the Borrow Checker but gives a deeper dive into the various stages the Rust compiler goes through when building code:

Joana de Castro Arnaud
10 months ago

I have more projects than I can count. Several involve writing a #compiler or #interpreter; some can be classified as #algorithmicart or #creativecoding; several are math- and game- related; and some miscellaneous ones.

Avid #reader of #fanfiction, #scifi and #fantasy. Amateur #writer of the same, plus #nonfiction and #microfiction.

Devilish :blobcateyes:

I thought "#compiler is allowed to do anything under #UndefinedBehavior" was a bit of a meme, but it's shocking to see it in practice.

Do is a static (local to this file) function pointer and it's only ever set in NeverCalled. So even though NeverCalled never actually gets executed, the compiler performs the set at compile time as an optimization and this is allowed because there is undefined behavior.


#c #cprogramming #cpp #rust

Screenshot of godbolt compiler explorer. Code on the left shows a function NeverCalled sets function pointer Do to EraseAll. main calls Do.

Compiler output on the right shows main is calling EraseAll.
Jordan Eldredge
11 months ago

Another #projects entry

I wrote a compiler that converts Winamp visualizer presets to Web Assembly so they can run efficiently and safely in the browser. The fun part is that the compiler itself runs in the browser.

Blog post:

#compiler #wasm #retro

A screenshot of Winamp running in the browser with a large, active, music visualizer window titled “Milkdrop”
José/Joana de Castro Arnaud
11 months ago

I have more projects than I can count, and way more than I can advance! There's not enough lifetime for them all.

One of my bigger projects is to implement a #compiler or #interpreter for a programming language. I started several, left behind incomplete.

Several other projects can be classified as "algorithmic art" or "creative coding"; when I started some of these, I didn't even know these names.