Do you want simple pascal compiler designed for boot loaders

Programming, for all ages and all languages.
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Do you want simple pascal compiler designed for boot loaders

Post by monobogdan »

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?
alexfru
Member
Member
Posts: 1111
Joined: Tue Mar 04, 2014 5:27 am

Re: Do you want simple pascal compiler designed for boot loa

Post by alexfru »

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.
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Do you want simple pascal compiler designed for boot loa

Post by iansjack »

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.
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: Do you want simple pascal compiler designed for boot loa

Post by monobogdan »

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.
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: Do you want simple pascal compiler designed for boot loa

Post by monobogdan »

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.
alexfru
Member
Member
Posts: 1111
Joined: Tue Mar 04, 2014 5:27 am

Re: Do you want simple pascal compiler designed for boot loa

Post by alexfru »

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

Re: Do you want simple pascal compiler designed for boot loa

Post by Love4Boobies »

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 ]
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Do you want simple pascal compiler designed for boot loa

Post by Kevin »

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)
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Do you want simple pascal compiler designed for boot loa

Post by Schol-R-LEA »

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.
Last edited by Schol-R-LEA on Tue Jan 31, 2017 9:22 am, edited 2 times in total.
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.
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: Do you want simple pascal compiler designed for boot loa

Post by monobogdan »

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
alexfru
Member
Member
Posts: 1111
Joined: Tue Mar 04, 2014 5:27 am

Re: Do you want simple pascal compiler designed for boot loa

Post by alexfru »

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.
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: Do you want simple pascal compiler designed for boot loa

Post by monobogdan »

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.
Кто мы то? Я здесь один
ronsor
Member
Member
Posts: 27
Joined: Wed Jan 25, 2017 5:31 pm
Libera.chat IRC: Ronsor

Re: Do you want simple pascal compiler designed for boot loa

Post by ronsor »

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."
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: Do you want simple pascal compiler designed for boot loa

Post by monobogdan »

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
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Do you want simple pascal compiler designed for boot loa

Post by Schol-R-LEA »

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.
Post Reply