OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:41 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Do you want simple pascal compiler designed for boot loaders
PostPosted: Sun Jan 29, 2017 2:43 pm 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
May be in free from OGDOS developing time i'm write simple pascal compiler, which generates very small assembler listing.

No rtl, you must write rtl by yourself(i mean writeln, readln and etc), it's for size economy.

Simplified pascal sublang:

Only while and for loops

Only variables, no consts

No delete, pos and etc, you must implement it by yourself

Only 5 base types:
Integer, Byte, Char, String, SmallInt

Only tiny memory model

Do you interesting in that?


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Sun Jan 29, 2017 3:02 pm 
Offline
Member
Member

Joined: Tue Mar 04, 2014 5:27 am
Posts: 1108
monobogdan wrote:
i'm write simple pascal compiler, which generates very small assembler listing.


LOL.

monobogdan wrote:
No rtl, you must write rtl by yourself(i mean writeln, readln and etc), it's for size economy.


LOL.

monobogdan wrote:
Simplified pascal sublang:

Only while and for loops

Only variables, no consts

No delete, pos and etc, you must implement it by yourself

Only 5 base types:
Integer, Byte, Char, String, SmallInt

Only tiny memory model

Do you interesting in that?


I got a C compiler much like that already.


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Sun Jan 29, 2017 3:50 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Writing a language compiler is great fun in its own right, but I see little prospect that anyone would be interested in using the compiler you describe.


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Sun Jan 29, 2017 3:55 pm 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
alexfru wrote:
monobogdan wrote:
i'm write simple pascal compiler, which generates very small assembler listing.


LOL.

monobogdan wrote:
No rtl, you must write rtl by yourself(i mean writeln, readln and etc), it's for size economy.


LOL.

monobogdan wrote:
Simplified pascal sublang:

Only while and for loops

Only variables, no consts

No delete, pos and etc, you must implement it by yourself

Only 5 base types:
Integer, Byte, Char, String, SmallInt

Only tiny memory model

Do you interesting in that?


I got a C compiler much like that already.


But C language is for C coders.

Someone, love pascal, and so, free pascal is not dead. And it's funny.


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Sun Jan 29, 2017 3:56 pm 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
iansjack wrote:
Writing a language compiler is great fun in its own right, but I see little prospect that anyone would be interested in using the compiler you describe.


Main goal is not only bootloaders, it's generate smallest code.


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Sun Jan 29, 2017 4:12 pm 
Offline
Member
Member

Joined: Tue Mar 04, 2014 5:27 am
Posts: 1108
monobogdan wrote:
Main goal is not only bootloaders, it's generate smallest code.


I should repeat. LOL. Let me elaborate a bit. Making a compiler that would generate fastest or smallest code is not a simple or easy task. Get a modern book on compilers to see what I'm talking about. And then, perhaps, take a look at the code of a decent optimizing compiler to see how it implements those optimizations that lead to smaller or faster code (not that I expect you to understand anything in there, but you should at least appreciate the work others have put into an optimizer and get a feeling of how complex and hard it is and that you have a very little idea of this at the moment).


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Sun Jan 29, 2017 11:07 pm 
Offline
Member
Member
User avatar

Joined: Fri Mar 07, 2008 5:36 pm
Posts: 2111
Location: Bucharest, Romania
Optimizing for small memory footprint is only valuable for some inexpensive, mass-produced embedded devices. For PCs, it really makes no sense to trade performance for size; code only takes a fraction of the memory data does.

Also, there are other bad mainstream languages out there, such as C, that most of us wish we could get rid of but cannot yet afford to do so because of all the existing code bases that need to be maintained. With Pascal, we absolutely can and, for the most part, already have. Don't let your nostalgia stop you from keeping with the times; with technology, you cannot afford to do so.

_________________
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Mon Jan 30, 2017 3:13 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
monobogdan wrote:
Do you interesting in that?

No. I did write a kernel in Pascal, but for that I need a good compiler, not some bad implementation of a tiny subset. And FreePascal already exists; if you want to create something useful, maybe contribute to FreePascal if you have anything to contribute.

And finally, before you write compiler for writing bootloaders (which is a topic so specific that writing a compiler specifically for it is probably not a good idea), maybe you should first learn yourself how to write a bootloader, and why that typical minimal hack from the tutorials is not a proper bootloader, and how to do it right. Because if you don't know how to write a proper bootloader, you can't write a tool for creating one.

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Mon Jan 30, 2017 8:21 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
Or better still, move along from boot loaders entirely and focus on an OS. As we have said many times before, here and in the wiki, focusing on the boot loader during an OS project makes as much sense as a dress designer spending years and years on developing a new way to sew, just because they didn't want to rely on existing sewing machines.

If the boot loader is your goal, then fine, work on that. But it isn't operating system design, despite what so many novices (including myself back in the day) initially think. Unless you have a specific, overriding reason why one of the existing boot loaders won't serve you, or you intend to make the boot loader itself your primary target, just pick one that's already there and use that. Otherwise, you are arguing over Mark Twain's proverbial skin of paint on the pinnacle of the Eiffel Tower.

And yes, I know how hypocritical I am being, but I actually have what I consider to be a reason for writing one, and I intend to spend a fair amount of time on it as a separate thing from my OS.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Last edited by Schol-R-LEA on Tue Jan 31, 2017 9:22 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Mon Jan 30, 2017 8:50 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
Kevin wrote:
monobogdan wrote:
Do you interesting in that?

No. I did write a kernel in Pascal, but for that I need a good compiler, not some bad implementation of a tiny subset. And FreePascal already exists; if you want to create something useful, maybe contribute to FreePascal if you have anything to contribute.

And finally, before you write compiler for writing bootloaders (which is a topic so specific that writing a compiler specifically for it is probably not a good idea), maybe you should first learn yourself how to write a bootloader, and why that typical minimal hack from the tutorials is not a proper bootloader, and how to do it right. Because if you don't know how to write a proper bootloader, you can't write a tool for creating one.

Before creating this topic, I calculated the possibilities and skills, so do not try to put me an idiot


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Mon Jan 30, 2017 9:57 am 
Offline
Member
Member

Joined: Tue Mar 04, 2014 5:27 am
Posts: 1108
I believe, most of us don't want or need the kind of compiler you're talking about (we don't see what important problems it would solve better than existing tools). We're also skeptical of your ability to do the optimizing part well. You appear overly optimistic.

But hey, if you still want to give it a try, please do. It will be a good learning journey if you don't quit too early.


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Mon Jan 30, 2017 10:59 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
alexfru wrote:
I believe, most of us don't want or need the kind of compiler you're talking about (we don't see what important problems it would solve better than existing tools). We're also skeptical of your ability to do the optimizing part well. You appear overly optimistic.

But hey, if you still want to give it a try, please do. It will be a good learning journey if you don't quit too early.


Кто мы то? Я здесь один


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Mon Jan 30, 2017 11:28 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 5:31 pm
Posts: 27
monobogdan wrote:
alexfru wrote:
I believe, most of us don't want or need the kind of compiler you're talking about (we don't see what important problems it would solve better than existing tools). We're also skeptical of your ability to do the optimizing part well. You appear overly optimistic.

But hey, if you still want to give it a try, please do. It will be a good learning journey if you don't quit too early.


Кто мы то? Я здесь один


Writing a compiler is not easy -- nor is an optimizing one. If you continue I remember seeing a tutorial on writing a compiler in pascal. There are also many examples if you search "simple compiler source code."


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Mon Jan 30, 2017 11:31 am 
Offline
Member
Member

Joined: Wed Jan 25, 2017 3:37 pm
Posts: 71
ronsor wrote:
monobogdan wrote:
alexfru wrote:
I believe, most of us don't want or need the kind of compiler you're talking about (we don't see what important problems it would solve better than existing tools). We're also skeptical of your ability to do the optimizing part well. You appear overly optimistic.

But hey, if you still want to give it a try, please do. It will be a good learning journey if you don't quit too early.


Кто мы то? Я здесь один


Writing a compiler is not easy -- nor is an optimizing one. If you continue I remember seeing a tutorial on writing a compiler in pascal. There are also many examples if you search "simple compiler source code."


Google translate is not your friend.

And so, i'm write compilers in past.

See my github repo.

http://github.com/monobogdan/ngc


Top
 Profile  
 
 Post subject: Re: Do you want simple pascal compiler designed for boot loa
PostPosted: Mon Jan 30, 2017 1:08 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
I know that you are focused on the target as much as on the language and the compiler, but you might want to take this discussion to our sister site, https://forum.compilerdev.org, if only because, well, it's more directly on topic there.

Also - and please pardon the shameless promotion - that site could you some love. I know quite a few people here are interested in language design and compiler development as well as operating systems, but it's a relatively new site so there hasn't been a lot of momentum there yet. We could use more participants there.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group