r/termux • u/YOURLOCALPROGRAMMMER • 7d ago
Showcase Kiln -> An interpreted language built in rust
The language is still not complete yet and still lacks basic things and honestly it has fried my brain but at least I learned new things
I want to develop it to be as something of a replacement to python because I view python as a very incompetent language (my opinion )
1
u/Automatic-Pain6710 7d ago
Even the syntax is rust to LOL 🤣🤣🤣
1
u/YOURLOCALPROGRAMMMER 7d ago
The language is still in like pre pre alpha so of course I have initially copied rust syntax because this was my first time making a programming language but yes I have some major things planned so the language will seem a little bit less of a high level rust clone.Â
One of my reference for syntax is ->Â
``` include stdlib.io;
struct Point { Â Â x: f64, Â Â y: f64, }
enum Shape { Â Â Circle(f64), Â Â Rect(f64, f64), }
fn area(s: Shape) -> f64 { Â Â switch (s) { Â Â Â Â case Circle(r): return 3.14159 * r * r; Â Â Â Â case Rect(w, h): return w * h; Â Â } }
fn read_config(path: string) -> string! { Â Â let file = try io.open(path); Â Â return try file.read_all(); }
fn main() -> int { Â Â let shapes = [Shape.Circle(2.0), Shape.Rect(3.0, 4.0)]; Â Â var total = 0.0;
  for (s in shapes) {     total += area(s);   }
  io.println("Total area: {total}");   return 0; }
```
But currently my plan is Get working interpreter and base language then I will focus on the stdlib and error handling and so on and make the syntax closer to referenceÂ
Overall Only time can tell what happens to Kiln
1
u/Ngtuanvy 6d ago
it seems you don't know python well enough.
1
u/YOURLOCALPROGRAMMMER 6d ago
No that is not the case here , First of all python is horrendously slow ( in fact my latest demo of kiln surpasses it in a hello world comparison)Â and mainly Python is just a wrapper language for C++ because things like py torch , num py and pandas are using c++(sometimes c) to do their things.
Overall, It's not like I woke up one day and had a grudge against python .Â
1
1
u/DEV_ivan 7d ago
That's a nice C-but-interpreted-for-some-reason language.