Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
what is best in optimizer pipeline
value numbering
code motion
peepholing
loop idiom recognition
legalization
thread gassing
op banning
View Results
 
  • Locked thread
gonadic io
Feb 16, 2011

>>=

flakeloaf posted:

kids today never make time for smalltalk

Adbot
ADBOT LOVES YOU

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

flakeloaf posted:

kids today never make time for smalltalk

The Management
Jan 2, 2010

sup, bitch?
java doesn't force me to declare a function that is in the same file if I use it before it's defined. it's time c[++] compilers caught up to this amazing 1995-era technology.

gonadic io
Feb 16, 2011

>>=

The Management posted:

java doesn't force me to declare a function that is in the same file if I use it before it's defined. it's time c[++] compilers caught up to this amazing 1995-era technology.

And F# lol

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
c/++ are supposed to compile down to asm in a very direct manner. if you want higher level functionality, you need to look elsewhere

Notorious b.s.d.
Jan 25, 2003

by Reene

Silver Alicorn posted:

c/++ are supposed to compile down to asm in a very direct manner. if you want higher level functionality, you need to look elsewhere

lol

The Management
Jan 2, 2010

sup, bitch?

Silver Alicorn posted:

c/++ are supposed to compile down to asm in a very direct manner. if you want higher level functionality, you need to look elsewhere

I don't need to declare my labels in assembly before branching to them either

Spatial
Nov 15, 2007

*reparses the same header for the 22,452nd time*

akadajet
Sep 14, 2003

The Management
Jan 2, 2010

sup, bitch?

Spatial posted:

*reparses the same header for the 22,452nd time*

*writes the same header inclusion guard boilerplate for the 1,000th time*

The Management
Jan 2, 2010

sup, bitch?
on the other hand, Ive been stuck with gcc for the last month and I forgot how bad it is. clang is so good.

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
again, totally not the use case for C (operating systems, low level programs and embedded code too big for assembly)

use java or Visual Basic or whateverthefuck

flakeloaf
Feb 26, 2003

Still better than android clock

the F# compiler is exactly one G♭

Spatial
Nov 15, 2007

c shouldn't be improved because it's not intended to be good - a moron

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
that’s the kind of thinking that gets you systems so bloated they can’t even run on a calculator

Notorious b.s.d.
Jan 25, 2003

by Reene

Silver Alicorn posted:

that’s the kind of thinking that gets you systems so bloated they can’t even run on a calculator

a modern hand calculator has an arm chip and gobs of ram

you could run java just fine if you wanted to

The Management
Jan 2, 2010

sup, bitch?

Silver Alicorn posted:

again, totally not the use case for C (operating systems, low level programs and embedded code too big for assembly)

use java or Visual Basic or whateverthefuck

my job is writing low level embedded code. I use c. declaring and maintaining static function declarations is a waste of my loving time.

feedmegin
Jul 30, 2008

Silver Alicorn posted:

again, totally not the use case for C (operating systems, low level programs and embedded code too big for assembly)

use java or Visual Basic or whateverthefuck

It's nothing to do with that, it's because single pass compilers were important in like 1970 because their computers were slow and had the memory of a modern microwave. Theres no real excuse for it in 2017 and it would have no effect on what actual code is generated.

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
yeah but then I won’t be able to run it on my Atari 800XL

Spatial
Nov 15, 2007

insert compiler disk 1
*whiiirrrrr*
insert compiler disk 2
*whiiirrrrr*
insert linker disk 1
*whiiirrrrr*

Silver Alicorn posted:

this has gone far enough!!

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



The Management posted:

my job is writing low level embedded code. I use c. declaring and maintaining static function declarations is a waste of my loving time.

write a script that slurps them into a header file that you include lol

gonadic io
Feb 16, 2011

>>=

Powaqoatse posted:

write a script that slurps them into a header file that you include lol

Otherwise known as the golang approach to good language usability

The Management
Jan 2, 2010

sup, bitch?

Powaqoatse posted:

write a script that slurps them into a header file that you include lol

now I have two problems

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



The Management posted:

now I have two problems

yes but the more arcane you can make the build system, the safer your job is!!!

ozymandOS
Jun 9, 2004

flakeloaf posted:

the F# compiler is exactly one G♭

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
every so often I think it might be fun to write a toy Pascal compiler that targets LLVM

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
like basically follow Wirth’s classic Compiler Construction but tweak it for classic Pascal and wire it up to LLVM

JawnV6
Jul 4, 2004

So hot ...

The Management posted:

on the other hand, Ive been stuck with gcc for the last month and I forgot how bad it is. clang is so good.

lol here i am whining that clang doesn't keep the inferred guess at a signature flexible enough to admit the later decl is good enough

JawnV6
Jul 4, 2004

So hot ...

Silver Alicorn posted:

c/++ are supposed to compile down to asm in a very direct manner. if you want higher level functionality, you need to look elsewhere

also i don't understand this argument, if i wanted to write asm id write asm

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
I would like to write a toy compiler (or even just an interpreter for a toy language) but not want to have to read 10,000 pages first. Where should I realistically start?

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
c allows you to write code that can be ported to different hardware with minimal effort.

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮

Volmarias posted:

I would like to write a toy compiler (or even just an interpreter for a toy language) but not want to have to read 10,000 pages first. Where should I realistically start?

http://www.atariarchives.org/2bml/

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

Volmarias posted:

I would like to write a toy compiler (or even just an interpreter for a toy language) but not want to have to read 10,000 pages first. Where should I realistically start?

do a scheme

TOPS-420
Feb 13, 2012

follow some simple rules in c (never use typedefs or prototypes, make all your functions return int) and youll never have to forward declare them

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

JawnV6 posted:

lol here i am whining that clang doesn't keep the inferred guess at a signature flexible enough to admit the later decl is good enough

the type of an undeclared function is defined by the language standard, not the compiler, and it can never be changed because the old terrible code that uses it is the sort of old terrible code that would rely on it

honestly i would not even want to improve the signature "guess" if we could because it would just make people think that it was at all acceptable to use the feature

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Volmarias posted:

I would like to write a toy compiler (or even just an interpreter for a toy language) but not want to have to read 10,000 pages first. Where should I realistically start?

that Nicklaus Wirth “Compiler Construction” book, seriously

in print it’s a trade paperback under 1cm thick and is all built around exercises

The Management
Jan 2, 2010

sup, bitch?

rjmccall posted:

the type of an undeclared function is defined by the language standard, not the compiler, and it can never be changed because the old terrible code that uses it is the sort of old terrible code that would rely on it

honestly i would not even want to improve the signature "guess" if we could because it would just make people think that it was at all acceptable to use the feature

clang -Wall --i-am-never-calling-undeclared-functions --seriously-my-code-isnt-from-the-80s --go-ahead-and-find-my-static-defines foo.c

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Volmarias posted:

I would like to write a toy compiler (or even just an interpreter for a toy language) but not want to have to read 10,000 pages first. Where should I realistically start?

this worked for me. if you're serious you should probably follow it up with something more serious but you write an interpreter from scratch (if you don't count the host language) and it took me about a week

https://interpreterbook.com/

i'd also do it in another language so you have to think through the problems on your own

DONT THREAD ON ME fucked around with this message at 23:39 on Aug 4, 2017

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Neat suggestions, thanks everyone!

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene

Volmarias posted:

I would like to write a toy compiler (or even just an interpreter for a toy language) but not want to have to read 10,000 pages first. Where should I realistically start?

for specifically compilers i am fond of the lcc book

https://sites.google.com/site/lccretargetablecompiler/

  • Locked thread