Richard Bucker

Programming Languages Languages Languages

Posted at — May 18, 2020

Uncle “Bob” Martin commented on the proliferation of new programming languages buy saying, hinting and suggesting:

but what he did not say

Where things go badly is when those noobs think

Back in the 1980s I wrote a lot of assembly language code. Later we added macro assembly. It was ALMOST a completely different language but it did not protect me in any way… Just made me/us more productive. When I think about C I see, essentially, a similar “macro”-ification. When I compiled my C code I could visually inspect the assmebler output for correctness and sometimes it just made debugging easier.

When C++ was introduced the assembler was practically incomprehendable. Remember ventor tables?

Just a few minutes ago I was listening/watching a 20-comthing presenting rust. Clearly the checkboxes that inspire him are strerotypical of his age and experience. And as a badge he showed a slide of a rust tcp echo and so just for fun I liiked for a tcl version of the same app.

# Echo_Server --
#	Open the server listening socket
#	and enter the Tcl event loop
# Arguments:
#	port	The server's port number

proc Echo_Server {port} {
    set s [socket -server EchoAccept $port]
    vwait forever

# Echo_Accept --
#	Accept a connection from a new client.
#	This is called after a new socket connection
#	has been created by Tcl.
# Arguments:
#	sock	The new socket connection to the client
#	addr	The client's IP address
#	port	The client's port number
proc EchoAccept {sock addr port} {
    global echo

    # Record the client's information

    puts "Accept $sock from $addr port $port"
    set echo(addr,$sock) [list $addr $port]

    # Ensure that each "puts" by the server
    # results in a network transmission

    fconfigure $sock -buffering line

    # Set up a callback for when the client sends data

    fileevent $sock readable [list Echo $sock]

With comments the tcl version is smaller an without, smaller still. While there is a lot that goes into this sort of scaling the tcl still made the point.

We are clearly at a point where we need better first class interpreters and we should be able to call them out. Javascript is not terrible but culd be better if it was considered just that. Nodejs goes too far to make js a scripting language. They are trying make javascript something it’s not.

So what’s next? I don’t know. I’m not an influencer. I strongly believe in the idea of ChromeOS, Android, iOS etc… that protected user experience is no different than a telnet terminal mate with a television. And that’s ok. Twenty years ago I was thinking about storing libraries of code fragments in a live DB. The implementation was essentially a contract in the spec. The framework was just an interpreter… and it pulled the code in on request. I still strive to implement one function per page… it’s readable and contains concepts that are easily managed and remembered.

Ah well… rust is not for me. The biggest reason is that all that wonderful performance comes at the cost of turning the flags off and the compile time.