Jump to content

Creating own language and compiler

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
15 replies to this topic

#1
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
Ok, i know (a bit) assembly. I know how i can make a language (that's not hard). But how the hell can i write a program that makes .exe files?

I mean, what i have to do is to take the text from the .programming_language file, and turn it to and .exe. How do i make an .exe? I DON'T want to convert to .asm and compile it again, i want to make the compiler myself.

Anybody know how?
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

#2
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
That requires you to write an assembler, which is a program that takes assembly source code and converts it to it's hexadecimal representation. I wouldn't know the first thing about writing an assembler, but I know there are several open source assemblers out there you can look at.

Davide said:

I know how i can make a language (that's not hard).
This is one of the few places where I find "LOL" to be highly appropriate. The assembler should be trivial compared to the compiler and language semantics.
Wow I changed my sig!

#3
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

Davide said:

Ok, i know (a bit) assembly. I know how i can make a language (that's not hard). But how the hell can i write a program that makes .exe files?

This statement is really interesting. First you say that making a programming language is easy, and just after that, you ask "how to make an .exe file?" (the really easy part). I assume that you have absolutely no idea of what a file really is. Have you heard about file headers, which describe the file information?
Another thing is, you must know more than a bit of assembly to make a programming language. You must really know assembly, architectures, the differences between them, parsing (tokenization, syntactic analysis, parse trees), compilation, optimizations, file formats, operating systems... just to name a few things. You must have a very good knowledge about programming, the most single mistake in compilation immediately leads to an invalid executable.

#4
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
An interpreted programming language is completly different, it doesnt require an exe, and guess what? I managed to make one, it's just that i don't like it like that.
A bit doesn't describes all my experience with assembly.

I found my answer guys btw, thanks for your help.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

#5
Phoenixz

Phoenixz

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 256 posts
Glad that you found your answer Davide, I'd be quite interesting to see a bit of your language just from curioisity.
Posted Image

#6
Ewe Loon

Ewe Loon

    Learning Programmer

  • Members
  • PipPipPip
  • 49 posts
I wrote a programming language (scripts) in delphi for a project im still working on
its very simple but adequate for its job,
originally everything was done as functions, however i have taught the compiler to handle + - * / and brackets
since it only uses floating point numbers and the Scripts aren't used outside the application all function are pre-coded into the application
although its very limited it is the basis of a fully functional language

I am working on a more advanced version for another project

#7
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,721 posts
@x42: Less than five minutes on Google got me this:

Processors
Intel
http://www.intel.com...nual/253666.pdf
http://www.intel.com...nual/253667.pdf

MIPS
http://dkrizanc.web....7/MIPS_Vol2.pdf

ARM
http://simplemachine...oc/arm_inst.pdf

SPARC
http://www.sparc.org/standards/V8.pdf

Interpreted Languages
Java
Java bytecode - Wikipedia, the free encyclopedia
Java bytecode:

Python
31.12. dis

Ruby
YARV: Yet another RubyVM / Instruction Table
sudo rm -rf /

#8
Shephard

Shephard

    Newbie

  • Members
  • Pip
  • 6 posts
I think that might be another one of those "LOL" moments

#9
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,721 posts
Seriously, x42, you need to spend some time looking on the Internet before you make claims like that. It's misleading.
sudo rm -rf /

#10
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts
This is like "he got owned". I have 6 big intel manuals that i have requested long time ago for free, 2 of them were posted by dargueta. It's pretty obvious that each processor have manuals that covers everything we need to know about them.

#11
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,721 posts
Ok guys, let's stop lambasting x42 and get back to the topic, shall we?
@ outsid3r: I like your avatar. Very true. :)
sudo rm -rf /

#12
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

dargueta said:

Ok guys, let's stop lambasting x42 and get back to the topic, shall we?
@ outsid3r: I like your avatar. Very true. :)

It was stolen from a guy named salem from another forum hehehe.