cpponline, to cpp

What’s New in Compiler Explorer? 2024 Update – by @mattgodbolt – C++Online 2024

https://www.youtube.com/watch?v=28Gp3TTQYp0

jesper, to haskell
@jesper@agda.club avatar

This is a great blog post on the WellTyped blog on specialization in Haskell! It's a good reminder that I (or someone) should really get around to getting rid of -fexpose-all-unfoldings and -fspecialize-agressively in the Agda codebase.

well-typed.com/blog/2024/04/choreographing-specialization-pt1/

(Also I didn't know about -flate-specialise and -fpolymorphic-specialisation, though I think I'd rather avoid relying on even more flags.)

#Haskell #compiler #performance #blog

janriemer, to random

While I'm rewriting my #transpiler from #nom to #chumsky, I'm actually thinking about writing a nom-to-chumsky transpiler...

➰ 🙃

#Compiler

janriemer, to showerthoughts

Feature request for code editors:

Command for jumping to the next file that has #compiler errors.

#Code #CodeEditor #Idea #Feature #Editor #LSP

bread80, to random
@bread80@mstdn.social avatar

I apologise for not posting this earlier.

is now alive! (At least Conway's variant of alive). The initial version was slow - about four seconds per generation. It was multiplying coordinates for each cell read and write.

The second variant uses offsets into each liner buffer, and only redraws changed cells. It's now running at three to four generations per second.

The next generation of the glider.

bread80, to random
@bread80@mstdn.social avatar

This week I added the Peek() and Poke() intrinsics to the . That means I can now write my first non-trivial program.

I spend this morning fixing a few bugs in the parser and code generator and it's successfully generating the assembler file.

The assembler is choking on a couple of issues with identifiers, and the output code has a couple of bugs to do with parameter parsing and result processing.

Very close to working <g>

A section of the output assembler code.

fell, to cpp
@fell@ma.fellr.net avatar

C++ compiler be like:

error LNK2001: unresolved external symbol "public: static class std::unordered_map&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;,unsigned int,struct std::hash&lt;class std::basic_string&lt;char,struct std::char_traits&lt;cha r&gt;,class std::allocator&lt;char&gt; &gt; &gt;,struct std::equal_to&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &gt;,class std::allocator&lt;struct std::pair&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const ,unsigned int&gt; &gt; &gt; TextureStore::texture_cache" (?texture_cache@TextureStore@@2V?$unordered_map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IU?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits @D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@std@@@2@@std@@A)

And expect me to casually read that and go "Ah, I see".

#cpp #cplusplus #cpp20 #programming #compiler #error

thelastpsion, to random
@thelastpsion@bitbang.social avatar

Class-building time for #ctran.

The compiler tutorials I've read don't talk about how to deal with classes and inheritance. I assume that a metaclass has to be built for each class. But should I then store those metaclasses for later use, or do I regenerate them when needed? I assume the former.

Also, my parser doesn't currently check for duplicate classes or methods (inside classes). Should it be in the parser, or should it be part of the thing that builds the output?

#compiler #preprocessor

deadblackclover, to random
@deadblackclover@functional.cafe avatar
etchedpixels, to 8bit
@etchedpixels@mastodon.social avatar

Progress on the #compiler. The Z8 now passes the test suite and the build coverage test. The test suite is pretty basic so there are probably plenty of bugs left. Code density is not great on the Z8 though. Also added register keywords for arguments to the compiler and split I/D to the linker.
The bytecode output for the #1802 also works with a bytecode engine in C, but the 1802 part is a long way off. Might have to stop putting off debugging the 65C816 now and carry on with #6502

janriemer, to rust

How to speed up #Rust compile times by 16x 🚀

In their blog post "Speeding up Rust edit-build-run cycle" David Lattimore shows how you can speed up #RustLang compile times by 16x by just changing some default compiler config:

https://davidlattimore.github.io/working-on-rust-iteration-time.html

Excellent read! Highly recommend!

Make sure to read to the end, as there is a surprise awaiting you - it's pretty wild.

#Compiler #Performance #wild

bread80, to random
@bread80@mstdn.social avatar

All of the operators are now passed over to the new data tables and primitive search. I'm moving onto intrinsics. These are small routines with function-like that often generate inline code, such as peek, inp and sizeof.

Many of these have quirks such as accepting multiple types, or a typedef. The quirk of Abs is unsigned values: in doesn't affect them. I could raise an error but it's nicer to fake the data to not generate any code.

#Quiche #Compiler #Z80

An extract from the primitives spreadsheet. The row for Integer type is normal. The next two rows are for Byte and Word input types. The 'Proc' column contains 'empty' which signals the code generator to not generate any code.

thelastpsion, to random
@thelastpsion@bitbang.social avatar

Musing on #ctran.

I'm starting to wonder if there's any point in having the lexer and parser as two separate classes.

Other than testing, the lexer is only ever going to be called by the parser, and only once during the process.

It might be better to just have a lexer-parser class that grabs a file, tokenises it, then (if it's happy with the file it's tokenised) immediately turns it into a tree.

Is there a really good reason why they should be separate classes?

#compiler #objectpascal #oop

deadblackclover, to badminton
@deadblackclover@functional.cafe avatar

A book about compiling Racket and Python to x86-64 assembly

https://github.com/IUCompilerCourse/Essentials-of-Compilation

minioctt, to Sony Italian

Altri di , ma in questo caso non colpa di : avevo visto (con rabbia e disperazione) che i Nestopia-UE e per (e questo punto chissà quanti altri!) facevano piantare per qualche secondo la , che poi si spegneva con un pop. A questo punto decido di vedere se anche su … e si, succede la stessa cosa, quindi non è colpa del mio hardware. 🤯️

Il grazioso mi dice però precisamente il motivo del … un jump a NULL, che è una cosa non proprio bella (in alto in foto), e mi dice molto poco. Purtroppo sulla PSP mi serve uno di quei core, perché voglio tenere quanta più possibile della mia centralizzata in RetroArch, e a quanto pare FCEUmm (l’unico altro disponibile per il ) ha qualche problema: inizialmente funzionava (come in basso a sinistra in foto), ma poi ha iniziato a rompere il video in modo (in basso a destra). (No, non ho provato a resettare tutta la configurazione, perché anche se risolvesse ora il non potrei farlo ogni volta che si ripresenta.) 💀️

https://octospacc.altervista.org/wp-content/uploads/2024/02/image-4-960x524.pngPurtroppo, come ormai sempre più mi capita, non trovo alcuna informazione rilevante al problema cercando sul web. E allora, unica mia possibilità: mi metto con l’animo in pace e provo a ritroso tutte le di RetroArch per la piattaforma, fino a trovare il punto di dove quei 2 core si sono rotti: a quanto pare, tra il 20 gennaio 2022 e il 5 marzo 2022; la 1.10.0 è a posto (stando a PPSSPP, ancora non ho provato sul vero metallo), mentre già la 1.10.1 presenta la . E noto una singola e particolare : il passaggio della del da 9.3.0 a 11.2.0. 🧐️

https://octospacc.altervista.org/wp-content/uploads/2024/02/image-5-960x275.png…A chi devo dare la colpa ora? Saranno stati quelli di GNU ad aver roba upstream? O piuttosto quelli dell’SDK per ? Perché ho skimmato commit e release della roba di , ma non riesco ad individuare il problema lì. Ma in ogni caso, perché certi core hanno smesso di funzionare brutalmente ed altri no? Questi sono i motivi per cui odio il . Ora non so nemmeno a chi devo creare la a riguardo. 🗡️

Per ora, la mia unica è di usare questa versione vecchietta del , sperando che non ci siano incompatibilità di savestate tra versioni diverse, perché voglio giustamente tenere quelle aggiornate sui dispositivi dove funzionano. Avendo poi più tempo, potrei tentare di compilare una versione recente del pacchetto usando il vecchio… ma probabilmente non ci riuscirò. 😩️

https://octospacc.altervista.org/2024/02/04/pspspsp-non-gradisce-nuovo-gcc/

shakthimaan, to random
@shakthimaan@mastodon.social avatar

Grace is an OCaml library with interfaces to build, report and render beautiful compiler error messages https://github.com/johnyob/grace #OCaml #Compiler #Usability

meisterluk, to webassembly

"The challenge of cross-language interoperability" by David Chisnall (2013)
https://dl.acm.org/doi/10.1145/2534706.2534719

The author is craving for an intermediate representation for general-purpose computational machines. A few years later it happened with #WebAssembly. #computerScience #compiler

bread80, to random
@bread80@mstdn.social avatar

Before Christmas I decided the #Quiche #compiler needed two big refactorings. The first is nearly done: the data tables for operands and primitives.

The OG version had grown confusing due to some poor initial decisions. It also put too much intelligence into the parser regarding the available types for each operator.

The new version allows the parser to scan the table to confirm if an operator can handle the operator types. It can also 'expand' types to find a match...

deadblackclover, to rust
@deadblackclover@functional.cafe avatar
thelastpsion, to random
@thelastpsion@bitbang.social avatar

I'm trying to work out where the line is between a lexer (tokeniser) and a parser.

How far should a lexer go before it's doing stuff that a parser should do? Should the lexer have some intelligence about what it's expecting to see next, or what needs to be ignored (e.g. comments)? Or should the lexer just make tokens and leave the rest to be left to the parser?

I'm not building a #compiler as such, but the principles are basically the same for a preprocessor.

gabrielesvelto, (edited ) to random
@gabrielesvelto@fosstodon.org avatar

Friends from the #compiler and #jit community, I have a question about Python's copy-and-patch JIT. This article claims it's a novel technique introduced in 2021: https://tonybaloney.github.io/posts/python-gets-a-jit.html

However this looks awfully like inline-threading which was first presented in 1998 (see this: https://dl.acm.org/doi/pdf/10.1145/277650.277743) and has already been applied to other languages and VMs (see for example SableVM's 2003 paper about their implementation: https://www.sable.mcgill.ca/publications/papers/2003-2/sable-paper-2003-2.pdf).

Is it really a different approach?

avp, to scheme
@avp@fosstodon.org avatar
shakthimaan, to javascript
@shakthimaan@mastodon.social avatar

Improving the dead code elimination algorithm in js_of_ocaml https://www.micahcantor.com/blog/js-of-ocaml-dead-code/ #JavaScript #OCaml #Compiler @tarides_

swetland, to golang
@swetland@chaos.social avatar

TIL that Go doesn't have bytes.Equal([]byte,string) or strings.Equal(string,[]byte) because as of 2019 the compiler is smart enough to make string([]byte) into a cast rather than a copy (possibly with allocation) when used in these types of comparisons.

I wish there was some central documentation of non-obvious "magical" optimizations like this.

https://go-review.googlesource.com/c/gofrontend/+/170894
https://go-review.googlesource.com/c/go/+/173323

#GoLang #Optimization #Documentation #TIL #Compiler

bytes, internal/bytealg: simplify Equal The compiler has advanced enough that it is cheaper to convert to strings than to go through the assembly trampolines to call runtime.memequal. Simplify Equal accordingly, and cull dead code from bytealg. While we're here, simplify Equal's documentation. Fixes #31587

hywan, to rust
@hywan@fosstodon.org avatar

Faster compilation with the parallel front-end in nightly, https://blog.rust-lang.org/2023/11/09/parallel-rustc.html.

The Rust compiler now has an intraprocess parallelism for its front-end, which allows faster compilation.

> our measurements on real-world code show that compile times can be reduced by up to 50%

That’s an incredible work. Congrats to the contributors!

#RustLang #performance #speed #compiler

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • InstantRegret
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • tacticalgear
  • ethstaker
  • modclub
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • provamag3
  • anitta
  • Leos
  • normalnudes
  • lostlight
  • All magazines