Sujet : Re: Top 10 most common hard skills listed on resumes...
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 28. Aug 2024, 14:51:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vana1g$3gbkr$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 28/08/2024 12:21, Michael S wrote:
On Sun, 25 Aug 2024 18:26:57 +0100
Bart <bc@freeuk.com> wrote:
On 25/08/2024 17:20, tTh wrote:
On 8/25/24 17:30, Bart wrote:
>
So what language goes between Assembly and C?
>
Forth ?
>
I had in mind languages classed as 'HLLs'. I'm not sure if Forth
counts.
>
They say that Forth is a HLL
https://www.forth.com/forth/
I tend to agree with them.
From 'forth.com', and a commercial site at that? They're going to be completely impartial of course!
This is the Ackermann function in Forth, from
https://rosettacode.org/wiki/Category:Forth :
: acker ( m n -- u )
over 0= IF nip 1+ EXIT THEN
swap 1- swap ( m-1 n -- )
dup 0= IF 1+ recurse EXIT THEN
1- over 1+ swap recurse recurse ;
Well, it's not assembly, but it doesn't have one characteristic of HLLs which is readability. The code for Ackermann can usually be trivially derived from its mathemetical definition; not so here.
So I say it fails the HLL test. But if it's not a HLL, it's also fails on low-level control: the above doesn't concern itself with types or bitwidths for example; you might consider that a HLL trait, but it's one that belongs the other side of C rather than below.
(Below are versions in more conventional syntax.)
My personal bar for HLL is pretty low - any language in which one can
write useful program (not necessarily big useful program or *very*
useful program) in a way that does not depend on instruction set of
underlying hardware is HLL.
Then you'd need to include any intermediate languages or representations, since they are usually not tied to any specific target either.
Although any static typing scheme will likely be crude, for example with type info specified per-instruction rather than centrally as in a normal HLL.
-------
(Examples from my languages)
func ack(m,n)=
case
when m=0 then
n+1
when n=0 then
ack(m-1,1)
else
ack(m-1,ack(m,n-1))
esac
end
(Compact version)
fun ack(m,n) = (m=0|n+1|(n=0|ack(m-1,1)|ack(m-1,ack(m,n-1))))
(Example for Haskell; usually considered difficult, here it is clearer than the Forth where the algorithm or formula is indiscernible)
ack :: Int -> Int -> Int
ack 0 n = succ n
ack m 0 = ack (m-1) 1
ack m n = ack (m-1) (ack m (n-1))