OSDev.org
https://forum.osdev.org/

Do you want simple pascal compiler designed for boot loaders
https://forum.osdev.org/viewtopic.php?f=13&t=31316
Page 1 of 2

Author:  monobogdan [ Sun Jan 29, 2017 2:43 pm ]
Post subject:  Do you want simple pascal compiler designed for boot loaders

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?

Author:  alexfru [ Sun Jan 29, 2017 3:02 pm ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Author:  iansjack [ Sun Jan 29, 2017 3:50 pm ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Author:  monobogdan [ Sun Jan 29, 2017 3:55 pm ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Author:  monobogdan [ Sun Jan 29, 2017 3:56 pm ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Author:  alexfru [ Sun Jan 29, 2017 4:12 pm ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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).

Author:  Love4Boobies [ Sun Jan 29, 2017 11:07 pm ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Author:  Kevin [ Mon Jan 30, 2017 3:13 am ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Author:  Schol-R-LEA [ Mon Jan 30, 2017 8:21 am ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Author:  monobogdan [ Mon Jan 30, 2017 8:50 am ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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

Author:  alexfru [ Mon Jan 30, 2017 9:57 am ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Author:  monobogdan [ Mon Jan 30, 2017 10:59 am ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.


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

Author:  ronsor [ Mon Jan 30, 2017 11:28 am ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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."

Author:  monobogdan [ Mon Jan 30, 2017 11:31 am ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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

Author:  Schol-R-LEA [ Mon Jan 30, 2017 1:08 pm ]
Post subject:  Re: Do you want simple pascal compiler designed for boot loa

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.

Page 1 of 2 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/