4 ms·
> Maybe the lesson is that we should find a f way to have syntax-independent programming languages! Just as we expect any successful language to have at least a
by wolfgke 9y ago
> Maybe the lesson is that we should find a f way to have syntax-independent programming languages! Just as we expect any successful language to have at least a couple implementations before being taken seriously, maybe we should expect a language to have at least a couple different alternative syntaxes and instant perfect translation between them (with comments and code style preserved), so I can use syntaxA and work on same codebase with my colleague using syntaxB.
Microsoft tried something very similar with C# vs VB.net (in the early days of .net there were even more experiments like J#). There exist tools to convert quite seamlessly between C# and VB.net code.
The result: except for some geeks people have decided that they prefer the C# syntax and it seems to me that Microsoft thus slowly tries to fade out VB.net.
So it rather seems to me that people don't like it if there are multiple coexisting syntaxes, because even if there are good converters available, it is still an inconvenience that wastes at least some productivity by mere existence of the multiple syntaxes.
- fiddlerwoaroof 9y agoWell, the “right” way to do it would be to make the textual representation of the syntax a view layer concern and not the format in which the code was serialized. For example, you could store everything as s-expressions or some binary representation of an AST and then have a lens that pretty prints the code with the programmers preferred syntax and the reverses the programmer’s edits to the underlying serialization format. I suspect this would work best for an image-based smalltalk-like system where the “source of truth” would be the version of the code persisted in the image and then the textual representation would be generated from that on demand.
- fiddlerwoaroof 9y agoA really interesting extension of this is to use lisp-style symbols instead of strings to represent variables, which would make it possible to localize the functions and keywords of your language so that a developer could collaborate in his/her preferred language.
- daanlo 9y agoMy understanding is that facebook also did that with PHP HipHop (PHP -> C) and react native (JS -> C/Java)
- pjmlp 9y ago> The result: except for some geeks people have decided that they prefer the C# syntax and it seems to me that Microsoft thus slowly tries to fade out VB.net. Not really, VB.NET enjoys much more MS love than F#. Just check the tooling and documentation at MSDN, or the set of languages supported for UWP development.
- wolfgke 9y ago> > The result: except for some geeks people have decided that they prefer the C# syntax and it seems to me that Microsoft thus slowly tries to fade out VB.net. > Not really, VB.NET enjoys much more MS love than F#. This is surely true, but in my opinion F# is more different from C#/VB.net than "just being for most parts a different code representation". So I would consider F# as an independent programming language - which indeed seems to be fallen out of favor by MS.