Easy Programming Languages

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Easy Programming Languages

Post 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 :)
DennisCGc

Re:Easy Programming Languages

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Easy Programming Languages

Post 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...
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Easy Programming Languages

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

Re:Easy Programming Languages

Post 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) ? ::)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Easy Programming Languages

Post 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 ;)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Easy Programming Languages

Post 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...
Every good solution is obvious once you've found it.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Easy Programming Languages

Post 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 :)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Easy Programming Languages

Post 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? ;-)
Every good solution is obvious once you've found it.
mystran

Re:Easy Programming Languages

Post 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.)
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:Easy Programming Languages

Post 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
ASHLEY4

Re:Easy Programming Languages

Post by ASHLEY4 »

So did Village People Y m C a ;D

ASHLEY4.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Easy Programming Languages

Post 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
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
DennisCGc

Re:Easy Programming Languages

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

Re:Easy Programming Languages

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