Gravitating towards Linux

Programming, for all ages and all languages.
User avatar
Venn
Posts: 22
Joined: Fri Sep 30, 2011 4:43 pm
Location: Under the mountain

Gravitating towards Linux

Post 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?
At Iðavoll met the mighty gods,
Shrines and temples they timbered high;
Forges they set, and they smithied ore,
Tongs they wrought, and tools they fashioned.

~Verse 9 of Völuspá
OSwhatever
Member
Member
Posts: 595
Joined: Mon Jul 05, 2010 4:15 pm

Re: Gravitating towards Linux

Post 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.
User avatar
Venn
Posts: 22
Joined: Fri Sep 30, 2011 4:43 pm
Location: Under the mountain

Re: Gravitating towards Linux

Post 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.
At Iðavoll met the mighty gods,
Shrines and temples they timbered high;
Forges they set, and they smithied ore,
Tongs they wrought, and tools they fashioned.

~Verse 9 of Völuspá
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Gravitating towards Linux

Post 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.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Gravitating towards Linux

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
OSwhatever
Member
Member
Posts: 595
Joined: Mon Jul 05, 2010 4:15 pm

Re: Gravitating towards Linux

Post 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.
bonch
Member
Member
Posts: 52
Joined: Thu Aug 18, 2011 11:19 pm

Re: Gravitating towards Linux

Post 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.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Gravitating towards Linux

Post by Love4Boobies »

berkus the troll
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Gravitating towards Linux

Post 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.
OSwhatever
Member
Member
Posts: 595
Joined: Mon Jul 05, 2010 4:15 pm

Re: Gravitating towards Linux

Post 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.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Gravitating towards Linux

Post by Brynet-Inc »

I, for one, do NOT welcome our new low level virtual machine overlords.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Gravitating towards Linux

Post 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.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
bonch
Member
Member
Posts: 52
Joined: Thu Aug 18, 2011 11:19 pm

Re: Gravitating towards Linux

Post by bonch »

I got a problem on my end too.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Gravitating towards Linux

Post by Brynet-Inc »

It's down here too now, meh, it'll be back up soon enough.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Gravitating towards Linux

Post by Combuster »

"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply