by 0xDEEPFAC · 7y ago · 0 comments
Not really. If anything concise core can be much easier to read. The key is to discard BS boilerplate and ceremonial code, and have the intention of the code clearer in less lines.
Python is far more readable than Java, for example, and far more concise.
>as well as "flexible typing" and type safe
Not if you support variant types and the like.
> Not if you support variant types and the like.
Not sure what you mean here - discriminant unions? classes?
No, I don't assume that. But I think that that's irrelevant. People didn't know "def" means function in Python or Scala either, but they learn it on the first day and don't have a readability problem with it.
Very basic keywords like "fn" are not the things that make a language unreadable, nor is calling the keyword "fn" instead of "function". Those are memorized in a day or so and you're done with it.
It's other things that make languages unreadable (too many sigils, overloaded operators or keywords in different contexts (C++, Perl), single letter operators (e.g. APL), too low level, too much verbosity, etc.
In any case, whether a person that first encounter a language immediately recognizes what a keyword means is not what makes the language readable. It's how readable it is to its programmers, after they know the language and have written code in it that matters. Familiar != readable.
>Everybody and their grandma can read Pascal and Ada, but abbreviated keywords and magical symbol require foreknowledge.
And almost everybody and their grandma dislike their syntax (especially Ada's), and would prefer something less verbose.
>And the more abbreviated, the more you will have to continuously look up things in the reference manual until they get cemented.
It's after such basics "get cemented" that readability comes into play, not before. If someone has to look after 2-3 days with the language what "fn" means or how to declare a function (and similarly, "def" in Python/Scala, etc), they have some serious memory issues.
(Btw, Rust, Clojure, and others also use "fn").
>Not sure what you mean here - discriminant unions? classes?
Yes, aka variant, aka tagged union, aka sum type...
Woa there, ever look at vector math libraries in C - horribly unreadable and ugly.
> too much verbosity
Verbosity describes a programs behavior without implied knowledge thus a reader of some code will understand exactly what is meant. I disagree that the definition of readability is all about how quickly you can skim source code - and ew too many words.
> And almost everybody and their grandma dislike their syntax (especially Ada's), and would prefer something less verbose.
Well, they were objectively designed to readability based on studies of other languages (at least Ada). And hey, I like it but I guess I am biased : P
But something like "fn" isn't going to be a problem, because you're going to use it a dozen times before you finish the tutorial. Symbols are also OK in proportion to their commonality. Rarely used symbols become more problematic. This can be mitigated if there's a clean way to find documentation for them, though you can't get around the problem that google is unlikely to ever be useful for them.
People have a habit of automatically doing this. It's why pretty much every niche field or industry develops jargon and three letter acronyms. Everyone gets tired of saying the whole thing so it's shortened.
Not only does it just make sense that things like "fn" are going to be okay, but there's also some mathematical backing as to why it's okay.
It is fundamentally statically-typed. However, a language that is too rigidly typed can sometimes degrade programmer productivity. Abstractions like variant types and various forms of type polymorphism can improve code flexibility and reuse, which is why I plan for Cone to include these features (the home page has a link to a page that describes this in more detail).
High-level attributes of a language are always hard to get right, because terms mean different things to different people, but several responders do a better job than I did of explaining why concise and readable don't necessarily have to be contradictory goals, at least for me. My primary aim here is that code be maintainable. By concise, I am actually far more focused on how much of a function's logic can fit readably on the editor window without scrolling than I am the size of keywords. Certain common C++/Rust patterns feel unnecessarily verbose to me (e.g., borrowing a reference in Rust), and I am trying to incorporate syntactic patterns from a number of other languages that I feel encode the same intent consistently in a way that a programmer familiar with Cone will be able to process and edit more quickly. Of course, that's always a judgement call...
Keep it up, I will be following the progress.
> ...focused on how much of a function's logic can fit readably on the editor window without scrolling than I am the size of keywords
This seems like a silly reason, we have large widescreen high res monitors - C's curly braces were invented to fit inside 70 char by 90 char terminals. Lets just be honest with ourselves and say its because its what people generally like and/or are used to these days : )
I mean Pascal/Ada isn't all that bad - it just not trendy https://github.com/AdaDoom3/AdaDoom3/blob/master/Engine/neo-...