#Implement a compiler target

1 messages · Page 1 of 1 (latest)

potent silo
#

Guys, if someone were to want to add a target to the compiler, how would they go on implementing it (no promises, as I don't have much time and apparently can't focus on side projects)

rich heron
#

@plush shadow can you share how you're setting up the LLVM target?

wide edge
#

If it's just for fun you can fork the project and get hacking 🙂

potent silo
#

But which places should I change / add

#

*files

#

I believe it's inside compiler_core

wide edge
#

That would depend on what you're making

#

Could be anything really

plush shadow
#

not hacking the compiler as i do not have the time to learn lifetimes rn

potent silo
#

not the lifetimes despair

rich heron
#

<a'> isn't real it can't hurt you

plush shadow
#

java is better than rust for 90% of applications and i will die on that hill

rich heron
#

have you considered, kotlin

plush shadow
#

im just making a point kotlin and c# both work

rich heron
#

but yes c++ c rust zig are overkill for many things

charred lodge
#

🧹

plush shadow
#

"Java gets 75% of the way there with 10% of the complexity"

#

idk but to answer the original question by @rich heron i parse my gleam using glance as it just does it for me then turn it into an intermediate representation in gleam and then i do codegen to a llvm ir string using that intermediate representation

charred lodge
potent silo
#

uhmm okay

gray cloak
#

You can also check how my fork diverged from main

potent silo
plush shadow
#

dream of self hosting

potent silo
#

interesting...

potent silo
plush shadow
charred lodge
#

@plush shadow did you see my project (gig) 👀

plush shadow
#

im going to do a full rewrite as im just messing around

potent silo
#

well, don't worry then

plush shadow
#

it was a big inspiration

potent silo
#

I guess I'll check Danielle's repo and see which strategy is better

#

(probably just in gleam tbf, as my rust is pretty... rusty (pun intended))

remote night
rich heron
remote night
#

Exactly

#

<'a> is very real and will hurt you

plush shadow