Page 2 of 3

Re:Easy Programming Languages

Posted: Fri Apr 23, 2004 2:49 am
by Pype.Clicker
FORTH would indeed worth the consideration (though i haven't tried myself). You need to know that Sparc and iMAC systems use a FORTH-based software for the BIOS of components ! funny, ain't it ?

However, it will certainly be more complicated to find good tutorials on 'how to write an OS in FORTH/modula, etc' ... And at the root, you'll need a FORTH interpreter in another language ...

The reason (imho) why C and ASM are the mainstream choices here is that those language are almost 'ready-to-execute' and can work with virtually no runtime support at all :)

A 'compiled' QuickBasic program was simply a pre-tokenized version of your QBasic program linked statically with the standard library (e.g. code that performs PRINT, INPUT etc. in machine language) and with the interpreter ... A compiled C program *IS* the machine code for what you requested :)

Re:Easy Programming Languages

Posted: Fri Apr 23, 2004 3:06 pm
by DennisCGc
ASHLEY4 wrote: I would agree that "Assembly language step-by-step" is a good beginners book for all languages.

ASHLEY4.
lol, I learned it from Norton's Machine Code book ;D
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
Hmm, of course it is ::)
Because humans are able to remind words better than symbols, it should be simpler.
I learned Basic as my first programming language ;D .
And perl ?
I never took a look at it ;) , so I can't tell it.

Re:Easy Programming Languages

Posted: Sat Apr 24, 2004 3:21 am
by Solar
DennisCGc wrote: Because humans are able to remind words better than symbols, it should be simpler.
Arguable. Since you are not talking to a human, and depending on your mindset, it might be "easier" to get what you want if you express yourself in a more computer-like language.
And perl ?
I never took a look at it ;) , so I can't tell it.
The saying that Perl is a write-only programming language is not that far from reality...

Re:Easy Programming Languages

Posted: Sun Apr 25, 2004 2:06 pm
by Pype.Clicker
that was a sort of 'proof by contradiction' ... Perl is easy by being complex. Its syntax is so weird that you probably will find your favourite way's supported but you're unlikely to understand someone else's program even if you already solved the same problem in the same language.

Code: Select all

if (! $value) print;
print if not $value;
print $_ unless $value;
$value or do { print; };
!$value && print;
are many possible way to tell the same thing in Perl, for instance, which is printing the 'current string' if $value is booleanly false. (null reference, empty string, 0 float or integer ...)

and there are probably even more such expressions ...

Re:Easy Programming Languages

Posted: Sun Apr 25, 2004 2:50 pm
by DennisCGc
Pype.Clicker wrote:

Code: Select all

if (! $value) print;
print if not $value;
print $_ unless $value;
$value or do { print; };
!$value && print;
are many possible way to tell the same thing in Perl, for instance, which is printing the 'current string' if $value is booleanly false. (null reference, empty string, 0 float or integer ...)

and there are probably even more such expressions ...
WOW :o
Why does a language need that many possibilities ?
Maybe for making it "easier" (I mean that it can be used for MANY ways, even in the programming) ? ::)

Re:Easy Programming Languages

Posted: Sun Apr 25, 2004 2:56 pm
by Pype.Clicker
DennisCGc wrote: Why does a language need that many possibilities ?
In order to
Make the impossible possible, the possible easy, the easy elegant ...
according to its author. And i must admit that with a bit of practice,

Code: Select all

open(F,$file) or die;
becomes just natural to write (while i would probably have skipped the check in C because if ((file=fopen("..."))!=NULL) { perror("open file"); } gets boring to type with the time ;)

Re:Easy Programming Languages

Posted: Mon Apr 26, 2004 12:43 am
by Solar
On the other hand, Perl doesn't even have a "switch" statement - you'll have to come up with one of several possible if - else if combinations...

Re:Easy Programming Languages

Posted: Mon Apr 26, 2004 1:11 am
by Candy
Pype.Clicker wrote: becomes just natural to write (while i would probably have skipped the check in C because if ((file=fopen("..."))!=NULL) { perror("open file"); } gets boring to type with the time ;)
And error-prone, as you've just proven:

Code: Select all

if ((file=fopen("..."))==NULL) {
   perror("open file"); 
}
You might want to test whether the returned object was equal to NULL and then complain :)

Re:Easy Programming Languages

Posted: Mon Apr 26, 2004 3:08 am
by Solar
Hehe... then again, while it's

Code: Select all

open(FILE, "< name.dat") || die("Error!");
it has to be

Code: Select all

system("command.exe") && die("Error!");
But haven't we strayed from the topic, here? ;-)

Re:Easy Programming Languages

Posted: Mon Apr 26, 2004 6:17 am
by mystran
I've avoided this thread, since I don't really like the attitude that is usually responsible for "is there [...] that is easy to learn", but I'll attack now.

I think the problem with the question is that there is a HUGE difference between "language that is easy to learn" and "language that is easy to learn program with (well)".

Say, Scheme is very easy to learn, as there are only a few things you need to learn. Learn the parenthesis-stuff, prefix notation, and basic special forms, and you are there. Ok, you know Scheme? Not really, since the whole language doesn't make much sense before you understand the full power of first-class functions, which seems to be very hard for most people (as observed first-hand). Add macros, and it becomes even harder.

Now, on the other hand, learning C might be quite difficult. There are huge amount of operators and rules, syntactic tricks, and standard libraries. On the other hand, as soon as you have a decent idea of the syntactic ideas behind C, you already know how to program with it. Well, at least I'd say that it takes less effort, since the language itself is quite simple.

Now, what is easy? I assumed easy means something along the lines of "not intellectually hard". If easy did mean "doesn't take too long if you really try hard" then this question is naturally totally different.

Whatever. Still, I think the question is irrelevant. The question really SHOULD be "What language would be best worth learning it." For each language, you get some amount of expressive power in exchange for the time and effort spent on learning it.
Now, since this is OSDEV thread, one will have to learn assembler to get anywhere. Therefore, the question is really, what language would save more trouble (when compared to assembler) than learning it causes.

Now, to give a practical answer too, I'd say that learning C is a good idea for any programmer, and quite well suited for osdevelopment. Don't try to learn it by writing a kernel with it though. It's better idea to write some normal applications first, to get a good idea how to do things with it.

I've never personally programmed with Forth, which was suggested at least by Schol-R-LEA, but it seems like a good language for things like osdev. On the other hand, if you've programmed with a structured language (like pascal, javascript, java, php, perl, python, ruby, c, c++, Algol,...) it probably feels weird at first. I've been given the impression that it's closer to the expressive power of Lisp than the already mentioned list of structured languages.

Oh, and one should learn Lisp (specifically Scheme) too, just because it helps you see the code from the parenthesis.

(Now, "structured language" is a category of programming language which really has nothing to do with the amount of structure in the language or it's syntax. At least not anymore.)

Re:Easy Programming Languages

Posted: Tue Apr 27, 2004 4:55 pm
by kataklinger
The Beatles - 'Write in C' ('Let It Be')

When I find my code in tons of trouble,
Friends and colleagues come to me,
Speaking words of wisdom:
"Write in C."

As the deadline fast approaches,
And bugs are all that I can see,
Somewhere, someone whispers:
"Write in C."

Write in C, Write in C,
Write in C, oh, Write in C.
LOGO's dead and buried,
Write in C.

I used to write a lot of FORTRAN,
For science it worked flawlessly.
Try using it for graphics!
Write in C.

If you've just spent nearly 30 hours
Debugging some assembly,
Soon you will be glad to
Write in C.

Write in C, Write in C,
Write in C, yeah, Write in C.
Only wimps use BASIC.
Write in C.

Write in C, Write in C
Write in C, oh, Write in C.
Pascal won't quite cut it.
Write in C.

Write in C, Write in C,
Write in C, yeah, Write in C.
Don't even mention COBOL.
Write in C.
;D ;D ;D

Re:Easy Programming Languages

Posted: Tue Apr 27, 2004 10:42 pm
by ASHLEY4
So did Village People Y m C a ;D

ASHLEY4.

Re:Easy Programming Languages

Posted: Wed Apr 28, 2004 8:50 am
by bubach
Why would Nasm be better then Fasm?
Only diffrenses i can see is that Fasm is selfcompiling (written in asm) and Nasm is written in C.
This makes Fasm alot smaller, but it does not makes it less good..

/ Christoffer

Re:Easy Programming Languages

Posted: Wed Apr 28, 2004 9:17 am
by DennisCGc
bubach wrote: Why would Nasm be better then Fasm?
Only diffrenses i can see is that Fasm is selfcompiling (written in asm) and Nasm is written in C.
This makes Fasm alot smaller, but it does not makes it less good..

/ Christoffer
My opinion is, that the syntax of NASM is better.

Re:Easy Programming Languages

Posted: Wed Apr 28, 2004 11:38 am
by ASHLEY4
The reason i think fasm is better, If you were starting to learn assembly now it,
1) Is It has on go support eg: http://board.flatassembler.net/
2) It does not need a linker.
The reason i think farm is better, if you were making a asm OS are:
1) It was made from the start to do just that,So there are lots of little
things that help you.
2) The size was what made me change and the fact that it was so easy to port (eg: MenuetOs),
To port Nasm to your OS , You would after port gcc :'( .
Also how can you call C programmers,if your assembler is made with it ;)

If i was making a mix ASM/C OS then i would go for Nasm.

Dennis, The syrtex is all most the same.

ASHLEY4.