Thread about the languages ( another one ? )

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Re: Thread about the languages ( another one ? )

Post by Dio »

venusian wrote:C is great on old processors because it reflects the hardware's capabilities, particularly of the VAX. It doesn't reflect most of the hardware capabilities of modern processors - ooo execution, threading, complex caches, asymmetric memories, branch prediction, SIMD, shared memories. Desktop processors (both Arm and x86) employ many of these things then try to hide them behind a VAX-like facade to make C/C++ programs happy.
Interesting thought. I understand what you mean with respect to multithreading and NUMA, but how do you think the rest would be better employed by a different high-level language?
User avatar
gravy
Sheepie Whore
Sheepie Whore
Posts: 19572
Joined: Wed May 01, 2002 1:28 pm 0
Location: The Other Place

Re: Thread about the languages ( another one ? )

Post by gravy »

venusian wrote:
GoatFoam wrote:So. er. c++ sucks on modern processors, except that it doesn't, but you hate it so it does?
Yes, that's precisely what I said.
GoatFoam wrote:I'm sure I am going to hear about functional programming saving the world in a minute, but so far it hasn't delivered. I wouldn't mind if it did, as concurrency in C likes is a ballache and I have better things to do, but it hasn't.
There are certainly a class of problems for which functional languages are better than C/C++. But not for systems and low-level programming, not for the sort of thing Giles is talking about.

C is great on old processors because it reflects the hardware's capabilities, particularly of the VAX. It doesn't reflect most of the hardware capabilities of modern processors - ooo execution, threading, complex caches, asymmetric memories, branch prediction, SIMD, shared memories. Desktop processors (both Arm and x86) employ many of these things then try to hide them behind a VAX-like facade to make C/C++ programs happy.
Yep.

Here's something I read recently about an experimental OS aimed for future HW. Their assumptions are it'l be loosely coupled, heterogenous CPU environment so they're concentrating on how you'd made an OS that'd work on something that sounds like a super fast Sega Saturn :D

http://barrelfish.org
User avatar
venusian
Baaaaaaa!
Baaaaaaa!
Posts: 6653
Joined: Wed Nov 06, 2002 2:22 pm 0
Location: South Gloucestershire

Re: Thread about the languages ( another one ? )

Post by venusian »

GoatFoam wrote:I haven't yet encountered a functional language runtime that makes particularly good use of any of the things you mentioned. It would be brilliant if I did, but I'm still waiting unfortunately.
Sigh. Who said anything about functional languages being good for this? Not me. In fact, I think I said the opposite
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Thread about the languages ( another one ? )

Post by GoatFoam »

Dio wrote: Interesting thought. I understand what you mean with respect to multithreading and NUMA, but how do you think the rest would be better employed by a different high-level language?
The theory is that the higher level language can determine an optimal execution order and location for each part of the program. Side effect free programming lets you do a lot of rescheduling so in principle you can optimise a lot. The optimiser could account for caches, NUMA, vector and distributed systems without bothering the programmer with details.

In practice the current state of the art give a tantalising combination of decent scaling and massive overheads on SMP* machines & not too much on message passing architectures..

*including the not quite SMP machines that most things seem to be these days.
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Thread about the languages ( another one ? )

Post by GoatFoam »

Anyway, there are believed to be an infinite number of models of computation. I'm after some sensible languages that take the path not followed. Comedy stuff from esolang need not apply :)
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Re: Thread about the languages ( another one ? )

Post by adam »

there is this then giles, if you're interested in new ideas but don't like high level languages, i'm not pushing new languages on you btw, was just suggesting a way you could avoid a bit more java if you wanted to in that other thread.

http://en.wikipedia.org/wiki/High_Level_Assembly

he did a whole site i think... there might be more hl asms , i found something like this a few years back with an online book as well, some may be better than others
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Re: Thread about the languages ( another one ? )

Post by Dio »

GoatFoam wrote:
Dio wrote:Interesting thought. I understand what you mean with respect to multithreading and NUMA, but how do you think the rest would be better employed by a different high-level language?
The theory is that the higher level language can determine an optimal execution order and location for each part of the program. Side effect free programming lets you do a lot of rescheduling so in principle you can optimise a lot. The optimiser could account for caches, NUMA, vector and distributed systems without bothering the programmer with details.
I was most interested in the comments on OOE, caches, branch prediction. I mean, I do a lot of asm programming, and there's really nothing I can do at the asm level to 'exploit' OOE - indeed, OOE actually takes away the point of lots of old-fashioned work like scheduling, since unless you can reorder an instruction by 10 or more instructions it's unlikely to affect an OOE CPU. And while I can certainly do a bit with branch prediction I struggle to see how that would be expressed in a high-level language except by PGO or similar techniques that already exist for C compilers.

Even caching - it's a rare algorithm which behaves very dramatically differently under different cache topologies other than 'faster'. So I was wondering what sort of thing I was missing :) .
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Thread about the languages ( another one ? )

Post by GoatFoam »

Well. The exact type of cache may not matter so much, but the cost of a cache miss is enough that you can make your code dramatically slower by ignoring it.
User avatar
gilesgoat
Sheepie Whore
Sheepie Whore
Posts: 27259
Joined: Wed Sep 03, 2003 7:54 am 0
Location: Monfalcone, Italy
Contact:

Re: Thread about the languages ( another one ? )

Post by gilesgoat »

gravy wrote:What languages have you any experience in giles? It's hard to understand where you're coming from without any context.
"A classic story" maybe.

Ok at my very first the very first true programming of anything I have ever seen, in books, was 8080A asm when I still have no computer of any kind.

Then the very first computer I put hands on was a Z80 1K ram .. yes there was basic .. but as you can understand "if you wanted to do something you had to use machine code" because you could not do much 'fast' in basic.

Then I went to the ZX .. again a case where "you need machine code to do nice stuff" but at that point I also found the HP4T15M compiler I went in love for Pascal because "oh it's high level, it compiles real fast".

That's been my first high level language I ever touched.

But ZX == Z80 ASM .. asm again ..

Then I got a Sinclair QL, quite disappointed in terms of speed and such, again a machine where if you really wanted to do something you had to use ASM, but then I started to love 68K asm.

That also been my first, EXTREMELY DISAPPOINTING experience with a bytecode thing, the famous/infamous UCSD Pascal which QL implementation was abysimal.

Then there was the Amiga days .. I never had an Amiga, too expensive, but I was interested/intrigued by it so "I had a look at things" I remember some things about BCPL - but never used - and then all this C people "were talking about" but "compilers" and stuff were still a bit 'posh thingies' in those days.

So I remember spending a whole summer devouring the K&R book I got somewhere thinking "this looks really cool".

Finally I managed to buy - after my second job - a floppy disk interface for QL, I also found - a miracle - an implementation of the C68 compiler for QL that was quite good, finally I could put hands 'on real C'.

But then basically the QL was more or less the only machine I could code on, PCs too expensive, not many people I knew had them it was not yet the era of 'popular PCs all around', people still had C64, VIC, ZX, ZX81, Amigas strangely enough were more popular than PCs, Apple II were still something but never wrote one single line of code in them, the ST in Italy was "almost never seen around".

I always been into graphics but in those time doing anything graphic was a bit 'crap' most people did not have much graphic cards or such at all.

I think, guess what, my very first experience of doing something on a PC with graphics been thanks to .. Borland Turbo Pascal .. again did not touch much because I never owned until quite late a PC.

Other things happens, UNI, FINALLY after some months they give us possibility to use "some computer".

It MUST be noted in those times - seems unreal today - the WHOLE UNI did not have many PCs around AT ALL NOR "so many machines" at all, suffice I say - NO JOKES - accounting and LOT of "important stuff" of the UNI until beginning of 1990 or so STILL was running ON A CDC6000 ! .. Yes, A CDC6000 ! That took for them quite lot of time to gracefully migrate all the stuff that was in there.

So my first "big computer experience" been "UTS882" .. which was a VAX/VMS ( 11/780 I think ) machine where the students had very limited access - OF EVERYTHING - including/especially CPU time that was "mentalist" I think you had something like MAX 100 seconds of CPU time per month, then you had to pray and sell your soul to your teacher and/or someone else to have some more CPU seconds if you were going over quota.

In that time there was "a very high resistance" to C .. "the word was FORTRAN all over the place" I learnt a bit of FORTRAN, I used a bit of it, finally after much resistance someone managed to have a C compiler bought and installed on that VAX, so I was using it in C as well.

Then I had a very brief experience, passing by, with INMOS transputers and had a very brief glimpse at OCCAM .. but "it blasted away" it was looking like "this is going to be the future of all" but incredibly got forgotten an vanished at the speed of light, I know there's also been a story to hide how much money been spent for nothing in certain things.

I vaguely remember some people in some places using a thing called COCOA but that wasn't the OSX thing, it was a language for math stuff.

Then things happens, left the uni, went into the navy .. so many things did happen there ..

Between this & that got to know some people working in some place .. long story can't really explain all of it but that gave me some limited access to some HP worstations and "introduced" me to the world of UNIX, X11 and a few other things ( like the idea of Hardware Accelerated Graphics ) .. can't even remember what they were using in those time.

Again .. C all over the place ..

Thanks to my knowledge of HW and especially 68K ASM I been hired to the place I spent around 9 years in, initially I was employed like "70% for working with HW, 30% for coding" .. then I got quite "into" some stuff and went more 50% 50% .. finally as things progressed we spent less time doing HW and more time doing SW.

But that was a bit of a "particular" envirronement, highly specialised in VME technology ( industrial stuff ) so almost everything we had was 68K based, OS9 ( 68K ) and some VAX/VMS plus "strange thingies with strange ASM", OS9 in particular was/is a kind of OS that "promotes lot you write ASM" .. and of course "C all the way round".

I spent time porting OS9 from one type of VME thing into another, writing device drivers, writing real time SW and such, communication protocols, SERIAL PORTS, MODEMS, finding spare bits in busses to drive other hw, attaching bits of HW to other bits of HW, hacking some HW to make it do other things out from what it was supposed to do.

Ah yes and stuff like reading 'standard' and RFCs with 'octects' and stuff like that and having problems like "if we get too many interrupts per second this chip slows down the other we have to speed it up someway" etc.

Then at some point we started 'the big project' that is still going nowadays.

In 199x something my brother and me put some money together and bought a PC, a not too expensive one, I still have it.

But in those times, no internet, no much money, not much such "getting stuff was a bit more difficult" especially good documentation/information, today you google, in those days google was not even there and let alone internet at home, good books were expensive too .. how you learn to code on a PC when you don't have really much to go on, not even a compiler to start with ?

Things and such happens, blah, etc. .. I started to discover Linux, I still remember something around first time I started to install a Slackware distro ..

Finally .. "I know C, I know something of X11" .. there you go ... my first graphic thing and stuff working nicely on a PC again was C and X11 and was Linux, I did try I remember to use/learn something of the newly create "QT" lib but in those times it was quite crap .. did not like it, stick to X11 ..

At work we literally had *TONS* and I mean *TONS* of code ENTIRELY written in C, if you would have dared to say "we could change language" they would have shown you the door, in fact as today with some small exceptions, they are still coding all in C/CPP ..

However I had 'the misfortune' to be put into "other things" .. so at some point I started to become "an expert" of things like "Active Directory" ( I read books ) "MS Exchange Server" , "MS Sharepoint/Shareportal/TeamServices" , "backup solutions", "fraking shit of ASP" .. at that point the begin of the decline began .. and so my insanity .. mostly not about the SW itself and such but about dealing with the people that wanted to have all that stuff and do things with it. I will only briefly mention "MS Project Manager" but it wasn't me using it, it was me suffering it ..

At home, it was C and asm.

Took me around 200x and something can't remember precisely when before I started to have internet at home.

My very first 'serious' PC coding experience I could probably say it's been Space Giraffe PC version, followed by GRR.

My very first NON-C thing been dipping a bit into SQL and PHP for obivious reasons.

My very first NON-C 'serious' thing I learnt to use and love is VHDL, I love VHDL.

My second NON-C 'serious' thing I had to learn at least a bit to use it been Obj-C for obivious reasons.

My third non-C thing is this fraking Java for making some of this Android stuff work, not because I like Java at all.

So there you go.

Ah yes my FUN thing because "I can't die without knowing at least a little of what this is about" :lol: , it's APL.

There was an idea like the above about LISP as well, but I tried many times, something of me refuses LISP.

Must be said ( apart the 'fun' part ) that ALL times I learnt something new is because I wanted/needed to have "something done" not because "just to learn it", I don't think one can never truly learn anything if there's not an immediate use for it, otherwise it's just 'read and forget'.

So there you go, in short.

Some points note remembering :

- it was NOT the time "of the internet"
- resources were what they were, money was very limited, access to stuff as well
- it was what it was around reasonably within reach
- constantly working under pressure
- you had to do 'things that work' in one way or another, "the good SW is only the one that
works without bugs and efficiently not the one with the nicely looking code"
- every resource was limited and costing money but "time" in those days wasn't so expensive
compared to the rest ( the machines were more expensive than you surely )

Hope this clarifies a bit.
Giles the billy goat
"Baa"
User avatar
gilesgoat
Sheepie Whore
Sheepie Whore
Posts: 27259
Joined: Wed Sep 03, 2003 7:54 am 0
Location: Monfalcone, Italy
Contact:

Re: Thread about the languages ( another one ? )

Post by gilesgoat »

I would dare to say add in this "many programmers never bothered/understood a shit about parallel programming".

And also "but a language that would do that automagically for you will never work as well".

If you want to do 'parallel' you have to start thinking 'parallel' at the very beginning of the stuff you want to solve/use it for.

You can still do it in C as well.

About that "wired" I mean more about the way "you like to see things in one way rather than another" nor that "you can't learn anything new".

Anwyay enough writing for today I have things to do :)
Giles the billy goat
"Baa"
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Re: Thread about the languages ( another one ? )

Post by Dio »

GoatFoam wrote:Well. The exact type of cache may not matter so much, but the cost of a cache miss is enough that you can make your code dramatically slower by ignoring it.
Sure. But over a whole program of non-trivial size this is impossible to effectively optimise for. A specific algorithm, maybe even a small portion of a program, may be able to achieve something - but, again, I'm not certain how a different high-level language could add better support for this. Indeed, the further you get from the metal, the harder it is to address caching...?
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Thread about the languages ( another one ? )

Post by GoatFoam »

yeah. It depends on what kind of work you are doing of course. A lot of the things I work on have lots of fluff where it doesn't really matter if it is optimised or not all all interspersed with heavy data crunching that takes long enough that minor inefficiencies show up as noticeable amounts of wall clock time.
User avatar
skip
Baaaaaa!
Baaaaaa!
Posts: 2455
Joined: Mon Sep 02, 2002 1:23 pm 0
Yahoo Messenger: oz_skip
Location: Adelaide, South Australia

Re: Thread about the languages ( another one ? )

Post by skip »

I used to know some ASM, Ada, Fortran, JavaScript (poorly) and who knows what else. I forgot all when i started doing some web stuff. Years of HTML and CSS shoved any programming skills clear out of my brain:(

Now the only thing I can do well is Actionscript 2. Though I generally detest Flash for websites, I can bang out a Space Invaders clone or something simple in an hour or two. I'm thinking of jumping to Actionscript 3 for the future proofing it offers (export to iOS, android, HTML 5 etc...all sub-optimally I'm sure). I don't even know if I even qualify as a programmer anymore :?
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Thread about the languages ( another one ? )

Post by GoatFoam »

A fiver says you could pick them up again and be doing things within a week.
User avatar
gravy
Sheepie Whore
Sheepie Whore
Posts: 19572
Joined: Wed May 01, 2002 1:28 pm 0
Location: The Other Place

Re: Thread about the languages ( another one ? )

Post by gravy »

gilesgoat wrote:Hope this clarifies a bit.
It's pretty much all old stuff and mostly imperative.

I must admit I'm with some of the other guys here in that wider exposure to other ways of doing things can have a really positive effect on the languages you do program.

It all depends about you relationship with programming I suppose, it's very different if coding is a means to an end or something you're genuinely enjoy for in itself.
Post Reply