[Dorset] Programming Languages. (Was: Using Two USB Audio Adaptors...)
Hi Hamish, > What languages do you like? Good question. Typically one well suited to the task, so there's not `one size fits all'. C for allowing close access to the hardware, and running with tight constraints. sed(1) for its model of stream-editing of text; it does more than just `s/foo/bar/g'. awk(1) for when sed isn't quite enough and more state and variables are required, or its automatic parsing into `words'. awk learnt from and kept sed's stream model. dc(1) when more maths is involved as it has unlimited precision, unlike C and awk's IEEE floating point. It's handy for varying bases and producing bytes. The syntax is terse, but then it does pre-date Unix and was the first program ported to it. :-) Here's a base94 string representing the current time. $ dc <<<94o`date +%s%N`p | > sed 's/^0$/ 00/; s/ ../33&+P/g; s/$/10P/' | > dc #^}FHB$_Ts m4(1) when a more structured parse of data is required, with macro expansions doing the work. Its macro model isn't like cpp(1)'s. sh(1)/bash(1) to bind these all together like some high-level programming language with powerful commands. perl(1) because it was skilfully woven by Larry Wall who knew the Unix programming environment inside out and what was required when a shell script was insufficient. It combines all the best bits of sed, awk, and sh with a fast implementation. The syntax is easier to understand if you already know its influences. But it went downhill when he left, now aping C++ in its complexity, and newcomers came along so these days I just use it occasionally in a pipeline as... python(1) is a good alternative, though not as fast. The syntax is clear, but it can still lure the unwary: l=[0, 1, 2]; m=l; m.remove(1); print(l) Go because it has that fine judgement in design that C struck all those decades ago. Not surprising giving its pedigree. It brings a garbage collector that can be tolerated and is still improving, a good standard library, and with the new `vgo' a reasonable way of importing third-party libraries into a project's code. The language specification is a single web page so it can settle in one's head over time. There are strong idioms used by the community. It has lots of good tooling surrounding it. It's C's successor in many areas. Of the assembly languages I used a lot, POWER and ARM were good. (ARM not including Thumb.) I like orthogonal RISC ones as they're less to remember and make for easier weaving. What do I consciously not use? Ada, C++, Java, Rust, Ruby, Lisp, Haskell, Javascript, ... I'd like to learn Snobol and/or Icon, particularly for their pattern matching, Verilog, and the RISC-V assembly language having bought a development board. :-) Cheers, Ralph. -- Next meeting: Bournemouth, Tuesday, 2018-05-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread: mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING Reporting bugs well: http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR
Re: [Dorset] Programming languages
On Sat, 2012-04-07 at 12:48 +0100, Ralph Corderoy wrote: Hi John, I swapped Perl and PHP, and FORTRAN and COBOL. I thought their Fortran was pretty unrecognisable compared to the Fortran I'm used to, but then I read and wrote Fortran 77. Generally, I thought a bigger example than Hello World would have been good; for some modern languages it's little more than two lines plus a couple of braces, not much room for signal. Cheers, Ralph. Fortran was one of those that I got wrong, but I did only use it for a couple of years at university pre- '76, and that was the Waterloo flavour called Watfor. After that it was PDP-11/3 assembler for a couple of years. And then in '79-80 I was using Forth, and I got that wrong too. Peter -- Next meeting: Bournemouth, Tuesday 2012-05-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
[Dorset] Programming languages
While you are relaxing: http://www.infoworld.com/d/application-development/hello-world-programming-languages-quiz-188874 I got 10 right, but should have got 12, as I got two wrong on languages that I used to use. (I'm not telling you which or how long I used those languages as I'm too embarrassed). Peter M -- Next meeting: Bournemouth, Tuesday 2012-05-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Programming languages
On Saturday 07 Apr 2012 10:18:10 Peter Merchant wrote: I got 10 right, but should have got 12, as I got two wrong on languages that I used to use. (I'm not telling you which or how long I used those languages as I'm too embarrassed). I got 7, but 90% of my answers were guesses. Out of all the languages listed, I've only ever written in Basic, C and C++ (a little). -- Terry Coles 64 bit computing with Kubuntu Linux -- Next meeting: Bournemouth, Tuesday 2012-05-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Programming languages
Hi Terry, I got 7, but 90% of my answers were guesses. Out of all the languages listed, I've only ever written in Basic, C and C++ (a little). 19 out of 20, though some had me thinking a bit; it helps to know language lineage too even if you're not overly familiar with the language itself. Cheers, Ralph. -- Next meeting: Bournemouth, Tuesday 2012-05-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Programming languages
Embarrassed to say 13/20 - eeek. A bit of guessing in places (by elimination) Si On 07.04.2012 10:18, Peter Merchant wrote: While you are relaxing: http://www.infoworld.com/d/application-development/hello-world-programming-languages-quiz-188874 I got 10 right, but should have got 12, as I got two wrong on languages that I used to use. (I'm not telling you which or how long I used those languages as I'm too embarrassed). -- Next meeting: Bournemouth, Tuesday 2012-05-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Programming languages
On 07/04/12 10:18, Peter Merchant wrote: While you are relaxing: http://www.infoworld.com/d/application-development/hello-world-programming-languages-quiz-188874 I got 10 right, but should have got 12, as I got two wrong on languages that I used to use. (I'm not telling you which or how long I used those languages as I'm too embarrassed). Peter M That was fun :) I got 15 out of 20. I swapped Perl and PHP, and FORTRAN and COBOL. I also mistook Scala for Objective C. -- Next meeting: Bournemouth, Tuesday 2012-05-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Programming languages
Hi John, I swapped Perl and PHP, and FORTRAN and COBOL. I thought their Fortran was pretty unrecognisable compared to the Fortran I'm used to, but then I read and wrote Fortran 77. Generally, I thought a bigger example than Hello World would have been good; for some modern languages it's little more than two lines plus a couple of braces, not much room for signal. Cheers, Ralph. -- Next meeting: Bournemouth, Tuesday 2012-05-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread on mailing list: mailto:dorset@mailman.lug.org.uk How to Report Bugs Effectively: http://goo.gl/4Xue