11 ms·
Designing a functional programming language: Yatta
- StreamBright 7y agoIt would be great to start a new programming language by stating what sort of actual problem it will solve (or handle better) than the other gazillion languages. Example: Rust -> memory safety, because based on many studies memory safety is responsible for ~70% of bugs. If you are just doing a language for the fun of it is still ok, even though I would be less interested in reading the post. As far as Yatta goes: "allows me to write programs as simple expressions, without having to worry about low-level stuff such as concurrency, with a beautiful syntax and a strong but dynamic type system." The first part is true to I do not know how many languages, the second part is subjective, I think LISP and ML have the best syntax some people throw up after opening the hello world examples.
- _bxg1 7y agoYeah, nothing is a bigger turn-off for me on the home page for a language or framework than starting off with "Helps you build [some combination of] simple, maintainable, fast, scalable software". No kidding! You and every single other language out there. This one isn't nearly as bad as that, but the point remains: tell me up-front why I should care.
- clarry 7y ago> The first part is true to I do not know how many languages, the second part is subjective And it's fine that way. There are lots of languages out there, and very few of them have any objective problem-solving features to justify their existence. Tackling some problem in a new way like Rust does (arguable, see prior art like Cyclone) is the exception, not the norm. Lots of languages are about improving subjective ergonomy while combining and tweaking features already found in other languages. Would it be fine to state that the language solves nothing for you and you can stop reading? But I don't think that needs to be stated any more than the post already did. Then the rest of the readers, who have an ounce of curiosity left in them, can scroll on and take the time to appreciate the design and see if they like where it's headed.
- tshanmu 7y agoElixir for the graalVM
- deleted 7y ago[deleted]
- weego 7y agoWhat is it with functional advocates and their obsession with brevity to the point of reductivism, and lack of visual structure
- kccqzy 7y agoSuccinctness is power. Paul Graham explained this way better than I could: http://www.paulgraham.com/power.html http://www.paulgraham.com/power.html On the other hand I don't agree with your point about visual structure. Personally I believe visual structure is mostly about code indentation. Visual structure can be apparent in any language, functional or not.
- striking 7y agoI don't understand. It looks a little like Ruby and Elixir mixed together, maybe without some colons that would otherwise be there. There's nothing crazy going on in the examples in the way of single letter variables or anything else I'd consider reductive. It's not really all that novel, and more of a pleasing combination of existing ideas. So why pin this on "functional advocates", whatever "this" even is? Maybe you could expound on your ideas a bit to help me understand your reasoning. Perhaps your comment is just incomplete rather than being wrong. (also, hopefully your qualms go further in depth than the syntax, because literally-skin-deep comparisons are a little boring)
- cryptoquick 7y agoThey're a cult of aesthetics. FP is just one tool in the toolbox. And for most things, it's the wrong tool.
- mumblemumble 7y agoInteresting. I agree that FP does have a bit too much fun with code golf, but I found the code examples in the article to be very clearly structured, readable, and not at all terse. Is it possible that your perception of a lack of structure is down to a lack of familiarity with the syntax and idioms in ML-style languages? I could see where perhaps not knowing what parts of the code are syntactic and what parts are stylistic causes it all to fade to gray. I've noticed a phenomenon along these lines when people are learning lisp: non-lispers and lisp learners tend to see nothing but parenthesis, because that's the most visually distinctive feature of lisp code compared to other syntaxes. More experienced lisp programmers, on the other hand, have a tendency to just tune them out. In well-formatted code, the parens themselves have very low information density, so you don't necessarily get a lot of value out of scrutinizing them.
- gliese1337 7y agoIt appears to me that the main selling point here is automatic parallelization, with futures/promises being abstracted away.
- adamkl 7y agoAgree: - Dead-simple concurrency model. Even if it won’t be the most performing one for some (or most) situations, it should be built into the language and be very easy to use. Ideally built with functions alone, requiring no special syntactic constructs. Advanced concurrency possible via STM. Most of the other design considerations sound like a description of Clojure: - Plain and simple syntax, minimal boilerplate, few keywords, no need for OOP constructs. The code must be very easy to read through. (this one is subjective I suppose. :-)) - Everything is an expression, no statements. The program itself is just a single expression. - First-class functions and modules. Modules are simply sets of functions and records. Modules can be further organized into packages. Function calls supporting tail-call optimizations. - Few data types. Yatta comes with the following built-in types: integer (64 bit), floating point number (64 bit), character (UTF-8), symbol, sequence (variable length, constant-time access to both ends), tuple (fixed length), dictionary, set and STM (Software Transactional Memory – coming in beta). No implicit conversions between types though! - Custom data types, or records. Records are basically just tuples with named fields, and syntax sugar that goes with it. - Run on JVM (GraalVM) and allow polyglot cooperation with other JVM languages. Very important if integrating with existing code-bases.
- bitwize 7y agoYatta: It's so easy, happy go lucky! https://youtu.be/rW6M8D41ZWU https://youtu.be/rW6M8D41ZWU
- carapace 7y agoFWIW, Frank Atanassow, "Some words of advice on language design" http://lambda-the-ultimate.org/node/687#comment-18074 http://lambda-the-ultimate.org/node/687#comment-18074 > Before you go off inventing new programming languages, please ask yourself these questions: > 1. What problem does this language solve? How can I make it precise? > 2. How can I show it solves this problem? How can I make it precise? > 3. Is there another solution? Do other languages solve this problem? How? What are the advantages of my solution? of their solution? What are the disadvantages of my solution? of their solution? > 4. How can I show that my solution cannot be expressed in some other language? That is, what is the unique property of my language which is lacking in others which enables a solution? > 5. What parts of my language are essential to that unique property?
- somewhereoutth 7y agoAll very good questions. However there is missing one question, that perhaps overrides them all: - By doing this will I gain a deeper appreciation of the art? Will it help others to see this too? Designing a good language is very very hard, harder maybe than a typeface, or a cathedral. But the rewards, in the terms of that question, can be inestimable.
- mathgladiator 6y agoThere is a lot of truth to this. I'm in the process of designing a language with integrated SQL where I "code-generate" the in-memory tables, and beyond appreciating language I also appreciate relational tables for what they do. What I am finding really nice is that I don't even have maps in my language since I can just use tables and get the benefits of maps along with indexing and all the fancy stuff.
- ModernMech 7y agoThis post has always irked me. It reads as straight up gate-keeping, especially when what follows these questions are a litany of negativity ("go home" "no one cares" "you are kidding yourself" and "you are wrong."). This is especially frustrating as the author later admits he himself cannot answer these questions honestly and yet persists in designing his own language. He certainly hasn't "gone home" so why should anyone else? Here's my advice: Want to invent a new programming language? Dive in. It doesn't matter if someone invented it before. It doesn't matter if you can't formalize it in mathematical notation at the outset (or ever). It doesn't matter if your language could be implemented in a library of another language. It doesn't matter if you can't articulate the precise benefits of your language. It doesn't matter if there are any benefits at all. It doesn't matter if you can't answer a single of the above questions. Have at it. You are guaranteed to a) learn a lot, and b) have fun. Maybe you do something completely derivative and that's fine. Maybe no one will appreciate what you do and that's fine. Maybe it will go nowhere, maybe it will never compile. Maybe you will be the only user. Maybe some guy on the internet will tell you to go home and no one cares. So what?
- gdsdfe 7y agothey should have just shared the project landing page => https://yatta-lang.org https://yatta-lang.org why another language? why not, who cares
- toolslive 7y agomaybe steal some date flow ideas from Oz https://en.wikipedia.org/wiki/Oz_(programming_language) https://en.wikipedia.org/wiki/Oz_(programming_language)
- leafmeal 7y ago> I do not want to fall in the trap of slow compilations and debugging mysterious typing errors again I always found that, instead of debugging type errors, in dynamic languages you end up debugging runtime errors. The errors don't go away, but with compiled languages at least they're easier to catch.
- mumblemumble 7y agoI'd add to that that type errors can happen at run-time, too, in any language that allows any level of dynamic typing. That includes fully dynamic languages (I swear, the most mysterious type errors I've ever fought with concerned Python libraries with insufficient documentation), but it also includes static languages like Java that permit unsafe downcasting.
- axilmar 6y agoIt seems the main point of this language is implicit concurrency. From what I have read, from the link above, the main idea is that it executes individual expression trees in separate threads, taking care of dependencies between threads and handling promises appropriately. It's a nice idea on paper, but I wonder how soon developing a "real" application with it will result in performance bottlenecks because the compiler could not capture the intentions of the programmer or the program is really difficult to untangle into different threads of execution.
- akovari 6y agoIt doesn't parallelize just "any" expression though. Only blocking functions, such as those working with IO. Similarly, in JS for example you would use callbacks to avoid blocking. In Yatta you don't have to explicitly worry about callbacks, Promises or alike, because they are hidden into the runtime itself. If you want to parallelize a computation, you can use function async, providing it a lambda, and then yes, Yatta can parallelize that as well (given that there are no other dependencies on it). But this is an explicit thing in control of the programmer.
- blackrock 6y agoI would like the Elixir without the Erlang. I would like the Python with some pipe forwarding. I would like the Python as a binary. I would like the package management of Rust. The speed and flexibility of C, but more consistent, and with less ability to make mistakes. Allow for a power mode, that turns off bounds checking, to boost speed.
- kwhitefoot 6y agoI would like a language that allows seamless piping to and from programs, specifically Unix tools. Just now my favourite language is Bash because: - concurrency is so simple that you forget you are doing it, - I can easily use other tools that far smarter people have written. The ability to execute other programs and capture their output always seems to be an afterthought in most languages.
- akovari 6y agoI agree, I want that too. It was not an afterthought in case of Yatta but rather a difficult tradeoff to make in terms of extending the syntax (which I try to keep minimalistic) and providing an easy interface for interacting with external processes. You can see the result of making this tradeoff here: https://yatta-lang.org/docs/stdlib/system/#running-a-pipeline-of-external-process https://yatta-lang.org/docs/stdlib/system/#running-a-pipelin... Not as "seamless" as bash maybe, and perhaps not feature-complete yet, but I hope this can serve as a starting point and we can build on this for future releases.
- kwhitefoot 6y agoBrilliant! I should have read more of your documentation. Which is very readable by the way.
- akovari 6y agoThanks! Don't hesitate to get in touch in case you encounter anything unclear, wrong, or missing.