Mind your language

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Mind your language

Post by Henk »



In the sixties and seventies you only had to learn Fortran.
In nineties only C.
Don't see functional language listed.

Fortran
Pascal
C
C++
Java
Javascript
Python
Tony P.
Posts: 216
Joined: Sun Jan 22, 2017 8:30 pm
Location: Russia

Re: Mind your language

Post by Tony P. »

Brace yourselves: Rust is coming :P I hope it's even going to overtake Scratch for the 17th place in the TIOBE index next month :lol: (you've read right - Scratch, a language aimed at children, is in the top 20 of that particular index - that's how tech-savvy the kids are becoming).
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Mind your language

Post by lucasart »

Tony P. wrote: Mon Jul 13, 2020 5:51 am Brace yourselves: Rust is coming :P I hope it's even going to overtake Scratch for the 17th place in the TIOBE index next month :lol: (you've read right - Scratch, a language aimed at children, is in the top 20 of that particular index - that's how tech-savvy the kids are becoming).
I am a bit skeptical about TIOBE. They say C is number one today, in 2020.

Sure, nothing pleases me more than seeing C way ahead of C++, and finally overtaking the infamous Java. But let's not confuse our dreams with reality…
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Tony P.
Posts: 216
Joined: Sun Jan 22, 2017 8:30 pm
Location: Russia

Re: Mind your language

Post by Tony P. »

Hmm, you've prompted me to look up their methodology, and I'm not sure if it even discerns C++ related search hits from C related ones correctly, as that would require all the 25 polled engines to be sensitive to the '++' suffix.
User avatar
Bo Persson
Posts: 243
Joined: Sat Mar 11, 2006 8:31 am
Location: Malmö, Sweden
Full name: Bo Persson

Re: Mind your language

Post by Bo Persson »

Tony P. wrote: Mon Jul 13, 2020 7:30 am Hmm, you've prompted me to look up their methodology, and I'm not sure if it even discerns C++ related search hits from C related ones correctly, as that would require all the 25 polled engines to be sensitive to the '++' suffix.
You might also wonder what search engines they used in the 1960's.
Tony P.
Posts: 216
Joined: Sun Jan 22, 2017 8:30 pm
Location: Russia

Re: Mind your language

Post by Tony P. »

The Youtube video used various sources of data, outlined in its description. It didn't use TIOBE alone, fortunately.
OliverBr
Posts: 725
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: Mind your language

Post by OliverBr »

lucasart wrote: Mon Jul 13, 2020 6:59 am
Sure, nothing pleases me more than seeing C way ahead of C++, and finally overtaking the infamous Java. But let's not confuse our dreams with reality…
C++ is not handsome, but Java is. Actually Java is a great language and it's not so slow as one may think...
Chess Engine OliThink: http://brausch.org/home/chess
OliThink GitHub:https://github.com/olithink
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: Mind your language

Post by Milos »

Tony P. wrote: Mon Jul 13, 2020 5:51 am Brace yourselves: Rust is coming :P I hope it's even going to overtake Scratch for the 17th place in the TIOBE index next month :lol: (you've read right - Scratch, a language aimed at children, is in the top 20 of that particular index - that's how tech-savvy the kids are becoming).
Hehe, Rust is coming for at least last 6-7 years. But still number of ppl that uses it can't even be measured with percentages.
Also popularity index like TIOBE is total BS. It's like measuring brand strength in consumer world. It means very little to nothing.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Mind your language

Post by bob »

In 1969/1970 PL/1 was "the up and coming language" with bits of Algol, FORTRAN and COBOL included. And then in the 80's it was ADA. There is always going to be the next great language that turns out to be "not so great". C is 50 years old. That much history can't be completely wrong.
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Mind your language

Post by mvanthoor »

C isn't a bad language.

It has been in development for almost 50 years. It can be optimized down to the last instruction nowadays. It does show some cracks however. Setting up a working build system that works across compilers across operating systems is much harder in C than it is modern languages. (That is not a language problem per se; it could be done, but no-one seems to be doing it for C.) Writing C that doesn't create undefined behavior is hard. Writing C that is memory safe is harder.

C is not an easy language to use right.

Although I prefer Rust nowadays for several reasons, if it hadn't existed, I would have probably written my engine in C. The only reason for not writing it in C, is because there are so many C engines already.

On the one hand, I love C for all of its power it gives you over the computer, the simplicity of the core language, and the speed.

On the other hand, I hate C because it'll blow your head off if you put an * or & in the wrong spot. Under water, Rust basically has the same memory management, but it handles all of the * (derefs) by itself, except in certain cases.

Let's say you have:

x = &y;

If you now print x in C, you get the memory address of y. If you wanted y, you'd need to print *x.
In C, this is correct, because x DOES contain the memory address of y.

In Rust:

x = &y

means "x is a reference to y", not "it contains the memory address of y". Under water, x DOES contain the memory address, obviously, but because of the different philosophy, if you print/use x, you will get y in Rust; because the language assumes you want to be using the thing x references to, not that things memory address. (You can use the memory address if you want to, but that is not the default.)

C gets complicated if you have pointers to pointers... in Rust, the compiler keeps track of that for you, and does all the de-referencing automatically, to give you the original struct/stuff you're pointing to. (If you don't tell it to do something else.)

This, and the semantic code analyzer built into the compiler, are the two main reasons for me to prefer Rust nowadays. I can do without, and I can use C, but... well... maybe I'll port my engine to C at some point after I finish it, just to have a C version, but I don't know yet.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL