+ 3

How can I build my own high level programming language?

Suppose I made a 'xyz' language.which syntax look like 💡 Val1 _value1 = 12; Val2 _value2 = 56.67890; Val3 _value3 = /just a string/; Operation operation(Val1 val1, Val2 val2, Val3 val3) [ Val2 val = val1+val2; Show(/Your result/ + Convert.IntoVal3(val)); ] 💡 1❓. Can I build high level language by using Microprocessor 8085 code? 2.❓ Do I need a other language(like python) to build my custom language? If yes then which language is better for that and if no then how do I do that? 3❓. Is the main job is to making Compiler? 4. I just want to build for knowledge and want to know is there really have need a new language? 5❓.I also want to add graphics facility in my programm then how do I implement that into a console programming language? 6❓.Can AI produce a all new programming language? ------------------------------------------------------------------------ Advance 🙏 Thankyou for your comment.

28th Aug 2022, 8:38 PM
Bapon Kar
Bapon Kar - avatar
4 Answers
+ 5
1. You can design a high level language for any hardware. The point is to create a transpiler that converts your language to assembly and then compile the produced objects to executable binaries specific for the platform. 2. If you want to target hardware, such as processors and microcontrollers, you will need to transpile into assembly and the compile that to binary. Otherwise, your transpiler could create virtual machine instructions instead. For instance scala is transpiled to Java virtual machine instructions and then executed in the Java virtual machine. But yes you will have to create a transpiler in another language and it doesn't matter which. In my experience, it's easier with a object oriented language. I have used Java for this purpose. 3. No. It's the transpiler. That's the minimum. The compiler is the entire chain that ends with the executable. You will need a transpiler. You could add optimizations but at least you need to produce a code for an intermediate language (such as assembly).
29th Aug 2022, 12:35 PM
Mustafa A
Mustafa A - avatar
+ 5
4. A new language can fix problems with existing languages. For instance Rust was developed to basically have tread and memory safe C++. 5. You could add bindings to your language. In order to use another language that has the resources your language is lacking. You could for instance transpile to C and use graphic resources of C. You would then create functions in your language that are place holders for the C functions and then transpile to those functions. You at last use the C compiler to produce the final executable. 6. Yes. How good it would be is another question.
29th Aug 2022, 12:42 PM
Mustafa A
Mustafa A - avatar
+ 1
Thanks Mustafa A for your long answer
29th Aug 2022, 4:01 PM
Bapon Kar
Bapon Kar - avatar
+ 1
Bapon Kar You're welcome.
29th Aug 2022, 7:06 PM
Mustafa A
Mustafa A - avatar