10 ms·
I would love to see announcements of new languages include a rationale. Why was this created? What problem was the author trying to solve that they thought the
by hermitdev 9y ago
I would love to see announcements of new languages include a rationale. Why was this created? What problem was the author trying to solve that they thought the solution was a new language? What short comings did existing languages have that this new language overcomes?
This is not a critique; I'm just curious.
- ppereira 9y agoWhy don't you just read the readme? The additional features are at the top, and examples in the body.
- hermitdev 9y agoI did. I saw lots of examples, but no answers to the questions I posed. The one source of rationale I saw was Lisp-like with no GC. Additionally, my comment was not directed solely at Dale, but new language announcements in general.
- deleted 9y ago[deleted]
- nickpsecurity 9y agoI created one a long time ago for reasons that seem to show up in others. Those included: Lisp-style macros are raw productivity/power; incremental, per-function compilation plus REPL = blazing, iteration speed; if using LCD of features, I can synthesize to more than one language/VM target; I can automate safety checks for C pitfalls without looking at cluttered code; way cleaner way to handle errors with similar benefit. Sadly, I lost that tool in a triple, HD crash along with most work. Loved it, though. I never even fully learned LISP or C but the subsets let me crank out tons functionality really fast then run it through optimizing C compilers.
- andrewshadura 9y agoYou should have put it up on GitHub.
- nickpsecurity 9y agoIt didn't exist at the time. I was gonna maybe turn it into a product, too. That be a great default today, though. Now I also know one can have paid, shared source. I might have opened it with free, perpetual licenses for any contributors.
- nonsince 9y agoI think that this developer, just like I, have drunk the homoiconic kool-aid. Homoiconic syntax is _fucking serious_ as far as productivity and enjoyment goes, it's like a whole separate world.
- geon 9y agoOr they just had fun? Why does a language have to be useful for anything?
- penpapersw 9y agoEverything is done for a reason. Sometimes that reason is just "to have fun / learn something new / expand ones horizons" and that's okay. But sometimes the reason is "to get the same amount of work done faster" and that's also okay. A lot of the mainstream languages were made for the second reason, but probably most hobbyist languages were made for the first.
- cortesoft 9y agoWriting a language for fun is totally fine, but it is useful to know that fact when the language is being shared. Am I looking at this language to see if it will be useful to solve a problem I have that existing languages don't solve, or is it just an exercise, or is it an improvement?
- geon 9y agoAll of those points are moot without adoption and maturity, something a new language by definition won't have.
- ikurei 9y agoNo, but there is still a big difference between a new language with a still-small community, but with ambition and some early attempts to apply it at "real" problems, vs a brainfuck-like, just for kicks language.
- 9y ago
- conistonwater 9y ago> What problem was the author trying to solve that they thought the solution was a new language? It could well be a cultural thing: for some people, "creating a new language" is a serious undertaking, but for others (especially those exposed to Lisp and Scheme), creating a new language is something you might do if you're curious about something. At the end of the day, creating a language just isn't all that hard to give it so much thought.
- DannyB2 9y agoIn Lisp / Scheme, people may create a tiny language to express the problem. Steps: 1. Create a new language in which the problem is trivially expressed. 2. Solve the problem in the new language. Lisp / Scheme are ideal for this. Example: solve some sort of puzzle game. Create a data structure that represents the board, a game piece and a move. Operators upon these. Given a board and a legal move, return a new board with the move applied. Given a board, give all of the possible legal moves (for a particular player if this a multi-player game instead of a puzzle). Once you have that language it becomes easy to use your favorite off the shelf search algorithms. Depth first. Breadth first. A*. Etc. But, this is probably not the same reason to create a "language" as the article. And the notion of "language" is quite different.
- cortesoft 9y agoWhat makes that a 'language' and not just a program? When I create a 'GameBoard' class in an OO language, I don't tell someone I created a new language. Doesn't a language have to be turing complete to be a language?
- wffurr 9y agoAre you sure your GameBoard class doesn't support the necessary primitives to be Turing complete? All you need is store and jump.
- deleted 9y ago[deleted]
- inputcoffee 9y agoA lot of the responses to hermitdev point out that a language can just be for fun, and need not "solve" anything. This is true, but hermitdev's point still stands: why was this particular idea pleasurable? Why c and lisp? Is it because they want a fast compiling lisp? Did they like the syntax of c but find it easier to implement in lisp's tree-like structure? What's the character motivation in this scene?
- kazinator 9y agoFurther clouding the picture is that Dale is actually implemented in C++. The inner syntax under the S-exps is grotty C++ data structures and some brutally ugly code to deal with them that doesn't seem to even try to leverage the ability of C++ to simulate a dynamic language (like with suitable. Like look at this fragment from https://github.com/tomhrr/dale/blob/master/src/dale/FunctionProcessor/FunctionProcessor.cpp https://github.com/tomhrr/dale/blob/master/src/dale/Function... bool isUnoverloadedMacro(Units *units, const char *name, std::vector<Node*> *lst, Function **macro_to_call) { std::map<std::string, std::vector<Function *> *>::iterator iter; Function *fn = NULL; for (std::vector<NSNode *>::reverse_iterator rb = units->top()->ctx->used_ns_nodes.rbegin(), re = units->top()->ctx->used_ns_nodes.rend(); rb != re; ++rb) { iter = (*rb)->ns->functions.find(name); if (iter != (*rb)->ns->functions.end()) { fn = (*iter->second)[0]; break; } } This is not even up to good C++ coding practice, what with the raw exception-unsafe pointers and whatnot. Name represented as char * ? I stopped using C strings in C++ code around 1998, other than in low level code interfacing with things that require them. Kids that were born then are now in college. If you're doing Lisp manipulation, you want anything that is a "name" of some kind to be an interned symbol, which quickly compares to another symbol variable as a pointer. Why would you do all this to yourself, if (or so it seems) you know enough about Lisp to want a C-like language in S-exp syntax?!
- hermitdev 9y agoYikes, yeah, this is bad. I only went through the readme, I didn't look at the source, and just...no. NULL? no. nullptr, please. And, as you've said, const char* as strings? again, no. I know GLS isn't terribly old, but something like string_view is in order. Arguments as undecorated pointers...no. Are they in or out? optional? C++ has semantics to indicate these things (even without GLS).
- omaranto 9y agoI would think that the rationale for any language with the syntax of Lisp but semantics similar to X is obvious: you want a language like X (that can be used for the things that X is used for) but with the meta-programming capabilities provided by Lisp-style macros. I can definitely see a Lisper thinking this rationale is so obvious that it does not require mentioning.
- tines 9y agoYep, macros are the only motivation needed for wrapping a language like C, and this project does a lot more than that. I've tried to come up with a way to do this myself, but I always hit a wall when it comes to integrating with the C preprocessor.
- nine_k 9y agoA regular, non-convoluted[1] syntax for C? Hygienic macros instead of defines? These two are sufficient reasons to consider it. But they also seem to offer namespaces, type inference (even through macros), sum types, anonymous functions, overloaded functions, a form of runtime introspection, and a bunch of goodies like containers in the stdlib. Quite an offering, I'd say. [1]: http://c-faq.com/decl/spiral.anderson.html http://c-faq.com/decl/spiral.anderson.html
- hermitdev 9y agoNamespaces & function overloading would make C a far saner place to live...
- zengid 9y agoFrom forum discussion: " Its development was prompted by the Common Lisp and Scheme tutorials that contrast syntactic macros with C preprocessor macros, and wanting to see whether syntactic macros could work in a lower-level language. " -Tom Harrison [1] [1] https://groups.google.com/forum/#!msg/dale-lang/h73oNq5U6MQ/_aS_pNB9G7cJ https://groups.google.com/forum/#!msg/dale-lang/h73oNq5U6MQ/...
- hermitdev 9y agoThanks for posting this. I had not perused the forums. This definitely sheds more light on what I was originally asking than just reading the readme.
- zengid 9y agoYou're welcome; I had to dig to find it. I, like you, would have preferred to see the motivation in the top-level documentation. It helps so much to see the core concerns that an abstraction is built upon, especially something as tangled and complex as a high-programming language.