“Screw it, I'll make my own” – The story of a new programming language
breuleux.net
breuleux.net
This rings very true. I look at Ceylon and the features I'm most jealous of are things that Scala would and should just do, except for the need to retain compatibility with 10 years of existing applications and libraries, so instead they're enhancement proposals for the version after the version after the next version, and in the meantime we get by with macros that more-or-less cover the most important use cases. And Scala is relatively young as languages go - its warts are nothing to those of, say, C++. Sometimes I wonder if language design can only advance by new languages killing existing languages - past a certain point it seems impossible to change a language in the ways that it needs to be changed to become good.
Probably nobody :) Oh well, I'll be here by myself getting muddy in this foot path next to the highway. But it might be entertaining to read about what I've been up to.
http://akkartik.name/post/libraries2
A compiler declares its claimed compliance by reference to these test suites:
> perl6 -v
This is Rakudo version 2016.01.1
built on MoarVM version 2016.01
implementing Perl 6.c.
6.c labels a frozen version of the Perl 6 test suite and thus a version of the Perl 6 language.All serious users of the language are encouraged to check/improve the language test suite to ensure it covers what they want covered in either an existing version or an upcoming one.
Major version switches not only don't retain backwards compatibility, but have in the past drastically changed the language. With v5.0 they finally seemed to hit on a good combination of features, syntax, and semantics, and the pace of new major releases has slowed noticeably.
I think it'll be a few years before Perl 6 matures enough for most folk to see why it matters, but its design incorporates Larry Wall's response to pg's http://www.paulgraham.com/hundred.html
Still, just the journey is quite interesting. It makes you understand other programming languages and their tradeoffs better, and I'm now much less afraid of parsers and lexers and so on. :)
Ahem, cough, cough, er, ...
I'm against the case-sensitive nature of some programming languages, and file systems for that matter. While it makes sense in a computing context (faster), you invent a new mode, just for the computer..
(Fortran was probably case-insensitive because upper-case letters were used first, and when lower-case letters were introduced, care was taken to neatly map them into the character set bit-wise, so one could simply clear the sixth binary digit to turn a lower-case letter into its upper-case equivalent, then continue the string comparison.)
Of course, with Unicode, you need a more complicated check, or you could just ignore Unicode in the language itself for identifiers, yet allow it in literals, data types, etc.
At least Tcl allows spaces in identifiers, but to 'use' such identifiers one does have to add a bit of extra 'sugar' to prevent the code parser from interpreting the spaces as token separators:
Example of spaces in a variable name:
$ rlwrap tclsh
% set "var name with spaces" "contents of the variable"
contents of the variable
% puts ${var name with spaces}
contents of the variable
% set "var name with spaces"
contents of the variable
Example of spaces in a procedure (function) name (the first line defines the procedure): % proc {my space proc} {string} {puts "'my space proc' called with string='$string'"}
% {my space proc} "hello how are you"
'my space proc' called with string='hello how are you'
% "my space proc" "the quick brown fox"
'my space proc' called with string='the quick brown fox'
% set pn "my space proc"
my space proc
% $pn "this that and the other"
'my space proc' called with string='this that and the other'
So there you have at least one example.The IMO better way to solve this is to set a convention for your programming language and enforce it with the compiler (at least with warnings).
Keep in mind we wouldn't need to care about enforcing case in a style guide, if case didn't matter, because there are no distinctions, and you'd be more inclined to write it the natural way; no camelCase to overrule ambiguation in writing "MIDI Port" as midiPort, or MidiPort, MIDIport, etc.
Case-sensitivity only creates unnecessary dissonance, and leads to clever uses of that system, adding even more choice; and as we know from The Matrix, the problem is choice. ;)
So if we keep it closer to how we would normally read and write words, I think there would be less dissonance about that aspect of programming, or naming files for that matter.
You would still need it to get uniform code. Spaces vs. tabs also doesn't matter but it's still in almost all style guides.
I don't see that case-sensitivity helps to achieve uniformity of code that much. Factors like code structure, common design patterns, and source code formatting are more important. The approach to the structure and design of an application or library is something that each individual development group decides for themselves. Source code formatting can (and should) be enforced by formatting tools.
Having used a case-insensitive language for a while (Object Pascal) I find that developers tend to follow the case convention of a given software project anyway and if they don't the case-sensitive typos aren't an issue. They don't make the code harder to understand and it all compiles.
It actually drives me a little nuts that I can't do the same thing in Elixir (compiler enforced lowercase) because so much of the code looks the same.
Newton-Raphson Runge-Kutta Fast-Fourier-Transform
Class-ID IO-Channel MIDI-port
Freudian-Id Io-Channel
In contrast to this, I feel it makes sense to have lowercase mean that something is private. Hence, no camelCase: x y z variable longer-variable-name
I've never been that comfortable about appending numerals to the end of identifiers to disambiguate them as I feel that this is a sign that they ideally ought to be subscripted and implemented as arrays. I much prefer hyphens to underscores but would ideally like to use individual words separated by spaces. This can only work if you have an IDE that hides all the underscores (which are incredibly ugly and serve no useful purpose in printed material these days) as you input them and outputs NBSPs instead and then uses similarly suppressed prefix sigils to style your raw input text into an output which conforms to traditional Mathematical notation. Hence, we could have: /foo_bar + /bar_qux
become:foo bar + bar qux
similarly, the following is not a problem if you take advantage of the syntax rule that requires at least one space either side of an operator. Hence, we could have:
/foo_bar / /bar-qux
become:foo bar / bar-qux
i.e. the / sign isn't echoed when you initially type it as it is expecting a letter, but when the IDE receives whitespace it belatedly echoes it as the operator symbol as it is now sure that it isn't a suppressed sigil.
I found some more tidbits in these StackOverflow answers:
http://programmers.stackexchange.com/questions/145751/has-wh...
(let ((|This variable has spaces| 1))
(print |This variable has spaces|))http://pogoscript.org/guide/variables.html http://www.nongnu.org/argile/ http://tibleiz.net/zinc/identifiers.html
(- x y)The one error that might be problematic depending on the language's semantics is if you write something like "x.y-z" intending to subtract "z" from "x.y", but in fact you are going to get the "y-z" property of "x". I must say that in Earl Grey you'll unfortunately end up with "undefined" as the result of that expression (saner languages would raise an exception on a missing property). I have never had that issue in practice, but then again, I always space subtraction.
I had initially jumped to the conclusion that your language would use a postfix notation and be more influenced by Forth than LISP. This is because I assumed it's name alluded to the way that Captain Jean Luc Picard would program his replicator.
Some programming languages generate code much deeper down the abstraction stack, e.g. Haskell generating machine code, whereas others generate code to a much shallower depth, e.g. most languages generating JavaScript. A language generating lisp code from some syntax could even be shunting code up the abstraction stack.
How deep does the generated code need to be down the stack for some syntax to earn the name "programming language"?
If two organisms of appropriate gender can't reproduce with each other, then they probably aren't the same species.
If code from two samples can't be interspersed, then it's probably not the same language.
I'd probably go with a definition more like "mutual intelligibility" like for natural languages, but that doesn't seem right either. Sometimes I have to turn on the subtitles for British TV.
I suspect we've all worked on software that you would desperately love to change something fundamental in the design but no matter how painful leaving it alone is, it is preferable to live with the pain than to tear it all down.
I've known a few writers for example that say they wish they could change their characters, but it's too late. I wonder if that's analogous.
Yet again today I have a Python project that is already (at 200 lines!) obviously massively compressible if I had macros.
Maybe I can get there by returning functions & building up the functionality that way, but it feels like I'm trying to scratch that spot in the middle of my back, where I can't quite reach.
Sure would be nice to have both on tap.