3 ms·
Ask HN: Can programming languages unify at all?
Imagine, as a long term goal if all the major programming languages moved towards using standard terms for well established concepts.
In computing there are many concepts that have multiple terms. Hash table and dictionary come to mind.
Consider also if basic actions had unified terms. In one language currently you add an item to an array with "push", and in another language you "append". What if all languages used the same term for the same action?
Thoughts?
- J_Darnley 11y agoIs push and append really the same action? Append to me clearly indicates that it does at the end and I would probably expect to use it last. Push might mean it goes at the front and I will use it first. Same goes for hash table and dictionary. A hash table describes the (probable) implementation but a dictionary usually just means a group of key-value pairs. In C that could be an array of pairs of pointers to C strings.
- w8rbt 11y agoMany of the terms and concepts are abstract and thus difficult for humans to fully understand (much less agree upon). Some of the terms and primitives go way back too (1980s). Thread research is a good example. And then the concrete implementations come along (pthreads, etc.) that may keep some names/concepts, but change others: 1989 - An Introduction to Programming with Threads https://birrell.org/andrew/papers/035-Threads.pdf https://birrell.org/andrew/papers/035-Threads.pdf 1992 - Beyond Multiprocessing: Multithreading the SUnOS Kernel https://www.usenix.org/legacy/publications/library/proceedings/sa92/eykholt.pdf https://www.usenix.org/legacy/publications/library/proceedin...
- stray 11y agoDifferent languages are different. That's mainly what makes them different. /s And actually, the terms you mention are subtly different as well. In part because of implementation details that will be different from otherwise similar languages. Push and append for example, seem to be adding elements to the opposite ends of the thing being pushed or appended to. Push goes to the head. Append goes to the tail. In Lisp for example, you push onto the head of a list while append concatenates the contents of multiple lists returning it all as one list. Arrays, which are not the same as lists in Lisp, have vector-push which does what Python's append method does. These things can't be unified because beneath the covers they use very different data structures. And some things would get lost in translation anyway. The word "macro" for example. C has macros, but C's macros are to Lisp's macros what a photograph is to a 3D movie. And Lisp's Condition System is unlike the closest thing in any other language I'm aware of. And returning multiple values. The only languages that I know of that do it are Assembly and Lisp. Other languages may return compound values -- but it's not the same. I don't know, brother -- you just have to do a little translation in your head. Like whenever those whacky Brits call trucks lorries, and bongs hubbly bubblies (actually, I dig that one).