Page 1 of 3

Easy Programming Languages

Posted: Wed Apr 21, 2004 6:20 pm
by Eos
I was wondering if there are some real easy languages that are easy to learn, but sofisticated enough to develop an OS.

Re:Easy Programming Languages

Posted: Wed Apr 21, 2004 10:01 pm
by ASHLEY4
This may come as a shock to most people, :o
But i truly believe that assembly is the easiest language to learn, Not the easiest to master.
This is because there are so few instructions to learn,and if you look at most asm examples, you will see the same instruction repeated in different combination over and over again.
Once you have a understanding of how memory works and which regs to use,proc etc,You will be well on your way to being able to program in asm.
And with great assemblers like FASM it is even easier :), eg: No red tape.

ASHLEY4.

Re:Easy Programming Languages

Posted: Wed Apr 21, 2004 10:12 pm
by Cemre
High level assembly is the best to program a kernel, here is the code for nasm to provide basic, if..else..endif, do..loop and for..next structures, explanation is provided inside the code...

Next choice would be C or C++, and I even heard that they use C# for this ( I don't know how [ C# ] )

hava fun...

Re:Easy Programming Languages

Posted: Wed Apr 21, 2004 10:15 pm
by Cemre
I have attached the code but it didn't go...
I'm re-trying...

if it doesn't go again, just download it from
www.ug.bcc.bilkent.edu.tr/~engino/sea.txt



[attachment deleted by admin]

Re:Easy Programming Languages

Posted: Wed Apr 21, 2004 10:18 pm
by Solar
I'd vote for C if you're looking for a good trade-off in simplicity and power.

While I tend to suggest C++ as a starting point to people who want to learn "all" about programming, it is certainly not easy to master in all its details, and chosing the right subset to start with is tricky. Actually, I consider C++ to be one of the most arcane "production" languages in existence.

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 3:37 am
by Pype.Clicker
An "easy" language ? how could one have an "easy" language to manipulate abstraction you'll have to create yourself ?...

What makes 'BASIC' easy, for instance is its built-in support for input/output simple commands, its native strings operators and the fact it prevents you from doing anything complex like hierarchical data structures ...

However, in an OS you *need* complex data structures, you're unlikely to have a large amount of strings (or whatever the complex type might be) and you have to implement input/output operations on your own ...

Think about it ... an 'easy' language would be unlikely to fit the task of low-level programming ...

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 7:55 am
by DennisCGc
ASHLEY4 wrote: This may come as a shock to most people, :o
But i truly believe that assembly is the easiest language to learn, Not the easiest to master.
This is because there are so few instructions to learn,and if you look at most asm examples, you will see the same instruction repeated in different combination over and over again.
Once you have a understanding of how memory works and which regs to use,proc etc,You will be well on your way to being able to program in asm.
And with great assemblers like FASM it is even easier :), eg: No red tape.

ASHLEY4.
True, it's a lot easier than C/C++ is ;)
And NASM is better than FASM, though it's my opinion.
What makes 'BASIC' easy, for instance is its built-in support for input/output simple commands, its native strings operators and the fact it prevents you from doing anything complex like hierarchical data structures ...
Basic is easy, because of the "simple" structure.
Why has to be everything complex ? ::)

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 8:17 am
by Pype.Clicker
lol. simple structure makes basic look simple, indeed. No parenthesis nor block delimitor. English words 'AND', 'OR' instead of obscure '&&' and '||' ... is that what you call 'simple' ?

In that case Perl is simple too :-P

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 10:25 am
by kernel_journeyman
Eos wrote: I was wondering if there are some real easy languages that are easy to learn, but sofisticated enough to develop an OS.
Hmm... I would have voted Python, since it is so readable and easily extended with C/C++, but then you just end up learning C/C++ to program the hardware anyway, along with assembly language. The Python interpreter would be embedded inside a microkernel of sorts which becomes a kernel executive (perhaps).

Then again, back into the real world... I cast my vote with C. This is because the tools for hacking C code are superior to tools for other languages, widely available and free; it needs minimal infrastructure (which you don't want hanging around when writing an OS, nor could you necessarily port it for being proprietary e.g. the JVM); it simplifies development by being more readable and portable than pure assembly language; you achieve a certain amount of code re-use with good design; you can learn more about OS development by reading other people's source code in C (and most OS sources are in C); and it's a small, elegant language and learned quickly and easily (compared to C++ or Java especially. Of course you need to invest much more time there to learn OOP to get the maximum benefits of those languages).

Stick with C. Years later you won't regret it.

Brief summary:
Assembler - terse, unfriendly for beginners, but fast and very easy access to hardware.
C - small and easy language to grasp, a "rung above" assembler (fast), needs a minimal standard library or none at all for all language features.
C++ - Quite fast (a rung above C), needs replacement of builtins like new and delete, can't use exceptions unless you implement them, messy linker issues with name mangling when using overloaded functions etc.
Java - Forget it. Only theoretically possible. Anyone ever seen Sun's JavaOS?
C# - Forget it, or write your own CLR host platform and C# compiler then go for it!

I have only the bare minimum of experience and knowledge to make this kind of choice however, so don't take what I've said as gospel, and get second opinions.

Hope this helps.

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 10:44 am
by Schol-R-LEA
C is hardly the only system language out there, even if it has proven the Fittest in the natural selection sense (i.e., it has outlived all of it's competition, such as Modula-2, BLISS, and so on). Still, Modula-2 and FORTH have not wholly vanished, and other possibilities exist; see the language threads in the General Programming forum for some discussion on developing new systems languages.

As for what is 'easy', that is a personal opinion, and one that is likely to change considerably with experience.

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 10:46 am
by ASHLEY4
And NASM is better than FASM, though it's my opinion.
Dennis, We will agree to differ on that one ;)

ASHLEY4.

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 11:07 am
by Schol-R-LEA
Regardless of which assembler you use, and which high level language you do most of the coding in, you'll need to be proficient in assembly in order to code an OS anyway. While I think ASHLEY4's statement about the easy of learning assembly is overstated, I do agree that learning the basics of assembly before learning C is a good idea; it's just that I recommend learning an interpreted HLL like Python or Scheme first, so that you can get an understanding of abstraction and algorithmics before diving into the low-level details.

As I've recommended many times before, the book Assembly Language Step by Step (see the book thread for details) is probably the best assembly-language book I know of for novices, though I know some disagree on this. Note that it really is a beginner's book, and that it provides all of it's examples in NASM (though converting it to FASM is easy enough if you want to, as it uses a very similar syntax; much of the code should work in both unchanged, IIUC). YMMV.

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 12:19 pm
by ASHLEY4
I would agree that "Assembly language step-by-step" is a good beginners book for all languages.

ASHLEY4.

Re:Easy Programming Languages

Posted: Thu Apr 22, 2004 2:01 pm
by Curufir
Actually I quite like the idea of writing something using LPC (Pike is a descendant). It's probably just my MUD background talking though, and the pain of writing an interpreter kinda puts me off.

Re:Easy Programming Languages

Posted: Fri Apr 23, 2004 1:02 am
by bubach
OT: I have also done some work in LPC, but it was a few years ago when i tried to do my own swedish mud..
I had a relly hard time to build a guild, so i gave up.. :-(
But i used a really bad mudlib, that may have been the case of my problems. I should have used the standard 2.4.5 (?) lib instead..
Fun to meet another "mud-person".. :-p

/ Christoffer