Page 1 of 2

Gravitating towards Linux

Posted: Thu Oct 27, 2011 10:44 am
by Venn
I find myself gravitating towards Linux for the initial development of my programming language like a moth to a flame. I find that system calls in Windows are overly complex, bloated and generally evil. For the purpose of developing a viable programming language, I feel that utilizing the Win32 assembly API to really over-complicate things. So, once complete, or at least showing some semblance of being releasable (actually a very long time from now), how hard will porting it to Win32 really be? Would it be better for me to simply develop it for Linux and then let the community port it to Win32?

Re: Gravitating towards Linux

Posted: Thu Oct 27, 2011 10:50 am
by OSwhatever
Venn wrote:I find myself gravitating towards Linux for the initial development of my programming language like a moth to a flame. I find that system calls in Windows are overly complex, bloated and generally evil. For the purpose of developing a viable programming language, I feel that utilizing the Win32 assembly API to really over-complicate things. So, once complete, or at least showing some semblance of being releasable (actually a very long time from now), how hard will porting it to Win32 really be? Would it be better for me to simply develop it for Linux and then let the community port it to Win32?
If you program you programming language using an OS dependent API, I think you're doing it wrong. In practice you should be fine with just the standard C/C++ libraries if you're using those languages. In general, use the language standard library as far as you can.

Re: Gravitating towards Linux

Posted: Thu Oct 27, 2011 11:30 am
by Venn
Oh no, no OS independent API lol. I will be using the Linux API that comes with FASM. C will actually be used to write the compiler software itself, but it will be compiled to assembly which will then be assembled and linked with FASM together with boilerplate code to "pull itself up by it's own bootstraps" as it were.

Re: Gravitating towards Linux

Posted: Thu Oct 27, 2011 12:53 pm
by turdus
Venn wrote:Oh no, no OS independent API lol.
It's called standard C library, and FASM can use it on Linux too. Read manuals. A compiler will need only a few functions: fopen, fread, fwrite, fclose, malloc, printf. No OS specific interface here.

Otherwise I assume you haven't spent much time on the topic, I suggest not to write a compiler (not yet to be precise). First you should be aware of how to tokenize, how to check syntax, how to specify a grammar, how to implement a grammar, how to semantically parse complex token phrases etc. etc. etc. Designing a language and writing a compiler for it is almost as hard as writing an OS. Believe me, I did it (and I also chose fasm by the way).

Don't do it if you're not familiar with at least 5 programming languages and have a really good and deep knowledge of compiler theory.

Re: Gravitating towards Linux

Posted: Thu Oct 27, 2011 2:55 pm
by Love4Boobies
Let me translate what the OP was trying to say: "Hey, I never looked into Win32 so I'm pretending to have an opinion because I don't want to look stupid. Please tell me what to do." Not only are your statements wrong, but you would also know how hard it would be to port your compiler to Win32 had you looked into it. Your compiler theory vocabulary also suggests that you're not yet up to the task. I'm not trying to offend you, just trying to say that you have the wrong attitude which will get in your way.

Now, for some clarifications:
  • Windows system calls aren't difficult to use. Not only that, but you're not even supposed to use them directly---that's what Microsoft provides all those DLLs for.
  • The Win32 ABI is not really more complicated than the System V ABI, which Linux uses. In fact, Windows does some things more efficiently (e.g., stdcall rather than cdecl).
  • The community will never port your language because you will be its only potential user, although I even doubt that.

Re: Gravitating towards Linux

Posted: Thu Oct 27, 2011 3:54 pm
by OSwhatever
Venn wrote:Oh no, no OS independent API lol. I will be using the Linux API that comes with FASM. C will actually be used to write the compiler software itself, but it will be compiled to assembly which will then be assembled and linked with FASM together with boilerplate code to "pull itself up by it's own bootstraps" as it were.
Alright, you do what you think is the best for your project. Good luck.

Re: Gravitating towards Linux

Posted: Thu Oct 27, 2011 7:07 pm
by bonch
Why not build a front end for LLVM and let it take care of your binary format? Seems to be the modern way to build a language.

Re: Gravitating towards Linux

Posted: Fri Oct 28, 2011 12:02 pm
by Love4Boobies
berkus the troll

Re: Gravitating towards Linux

Posted: Fri Oct 28, 2011 2:04 pm
by NickJohnson
Venn wrote:C will actually be used to write the compiler software itself, but it will be compiled to assembly which will then be assembled and linked with FASM
@berkus: The OP explicitly said he would be writing the compiler in C; C++ using LLVM is not that far off.

Re: Gravitating towards Linux

Posted: Fri Oct 28, 2011 4:24 pm
by OSwhatever
I just try to reassess what he is describing.

He writes some kind of compiler in C which is compiled to some kind of assembly code then it is linked (after compiling it I guess) together with some boilerplate code which I assume is some FASM Linux API library something. He previously tried to use pure Win32 calls, then he thinks that they are over-complicated, and also worried that porting from Linux API to Win32 will be complicated.

He's moving to Linux API because he likes them betters so there is nothing to discuss to begin with. It's good that he tries to keep things simple.

Re: Gravitating towards Linux

Posted: Fri Oct 28, 2011 9:26 pm
by Brynet-Inc
I, for one, do NOT welcome our new low level virtual machine overlords.

Re: Gravitating towards Linux

Posted: Sat Oct 29, 2011 8:01 am
by Brynet-Inc
berkus wrote:
Brynet-Inc wrote:I, for one, do NOT welcome our new low level virtual machine overlords.
Your link doesn't work.
It works fine, problem is at your end.

Re: Gravitating towards Linux

Posted: Sat Oct 29, 2011 8:14 am
by bonch
I got a problem on my end too.

Re: Gravitating towards Linux

Posted: Sat Oct 29, 2011 8:38 am
by Brynet-Inc
It's down here too now, meh, it'll be back up soon enough.

Re: Gravitating towards Linux

Posted: Sun Oct 30, 2011 11:59 pm
by Combuster