Skip to main content

Command Palette

Search for a command to run...

I'm writing a compiler... for a special language

I love making programming languages and 3D stuff... why not doing something in a row ?

Updated
3 min read

Junon is my project. A general-purpose programming language, with a modern view and thought to be easily learned and a 3D engine to make 3D softwares, video games and all stuff possible with 3D. Multi-platform, for sure.

The language is really not finished. Please be careful with the code you write in Junon, the syntax checker is poor for the moment. But I'm working hard to make this project truly awesome !

Remember, you are looking at the first steps of Junon project :)

The "3D part" is not implemented yet, follow Junon on Github or this blog to be notified of the next updates :)

Take a tour of the (current) Junon language

Let's make a hello world !

fun main { 
    print 'hello world!\n' 
    ret 0 
}

Take note that print is a keyword for the native system call, not a function. The standard library has not been made yet.

The language is constructed from a simple principle

<instruction> <direct value> 
or 
<instruction> { 
    <?instructions...> 
    <expression end's value> 
}

{ ... } is an expression

See that with a code example :

let x: int = 5 // first way 
let y: int = { // second way print 
    'I love Junon !\n' 
    let x: int = 3 // another scope, this `x` is different than the first one 
    { 5 + x } 
} 
let z: int = { 2 + 2 }

Similar to Rust.

Currently available instructions :

  • fun : for a function declaration (why not "func" ? it's less fun !)

  • ret : to return (? with a value) the function

  • print and exit : native syscalls

  • let and static : (?static) variable creation

  • @ : macro to directly write Assembly code

Write direct assembly code : fun main { @ mov rax, 5 ret }

This doesn't exist for the moment, but I know how to implement that even if it's a compiled language :

let a: int = 3

if a == 3 { 
    print 'hello world!\n' 
}

fun main { 
    ret 0 
}

Right, it looks like an interpreted language, but trust me, it's a compiled language.

It already permits to create an (os-native) library or an executable binary. Read the help page by doing a simple : juc --help

What makes the Junon language better for 3D ? It's a simple but compiled language, then you have only to be concentrated on the "3D part", and forget the language problems, this is simple. The linked 3D engine will be created from this principle of simplicity

Then, these are the repositories of the related projects around the Junon compiler (juc) :

  • jup : The Junon source code parser and syntax checker, to be easily used in all community projects, also used by juc

  • x64asm : Generate Assembly code more properly in Rust, thought to be used with nasm.

  • rslog : Generate beautiful logs for your program (originally designed for compilers/interpreters)

I'm thinking about adding VR for Android later. Is that interesting to add ?

Thanks for reading me. See you soon for new adventures !

Gift : The Junon project logo :

Junon logo

S

It's great seeing this , I can't wait to use it

1
A
Anтo3y ago

Thanks ! You can contribute or just see the repository of the compiler at https://github.com/junon-corp/juc ! You will see all news on it.

S

I wish I can , I have never written a language before and I don't know how to write one but if I can learn, I have a lot to contribute. Antonin Hérault

1
A

Good luck with this challenge I see a bright future ahead Antonin Hérault.

1
A
Anтo4y ago

Thank you!

B

man looks like your language will be fun to use, All the best

1
A
Anтo4y ago

thanks, I will do all my best to make Junon fun

J

Pretty stuff, @antoninhrlt. Thanks for writing this here. Would love to get about writing a programming language too. What resource do you use? "Crafting compilers"? ... :p

1
A
Anтo4y ago

Thank you, hey contact me on Discord : Anto#3722, then we could talk about that in a better way

E

Nice work!

1
A
Anтo4y ago

Thanks!

N

Best of luck. Waiting to see you shine.

1
A
Anтo4y ago

Thank you !!

A

All the very best!! Keep learning, let's make this world a beautifull :place.

1
A
Anтo4y ago

Thanks :)

Y

All the very best! Keep it up!

I just started learning Rust so I will try and understand more of your work once I have a better understanding of Macros in Rust.

See you till the next update!

4
A
Anтo4y ago

Your reply makes me very happy ! Thank you so much

See you soon so :)

1

Presentations

Part 1 of 1

It's me sharing you my projects or cool tools you wish you'd known about before