It's more of a mashup of Ruby, Lua, and JS to my eyes, and its syntax makes some mistakes at first glance that any C-inspired language shouldn't be making these days, such as the "dangling else". It looks like it could really do with Go- and Python-style namespacing of imports.
Yeah, I'm not seeing anything super compelling here beyond what, say, Lua can do, but I'm willing to be proven wrong.
To answer your first question, it looks like dragon-lang works on the JVM, whereas native uses LLVM. Seems to be some small differences in what modules need loading too.
But yeah, without seeing any "real" code written in Dragon, makes it very hard to evaluate its ease-of-use.
It doesn't look like it has something that differentiate it from other languages and the main page I feel also doesn't sell it very well
It does say that it offers "features that enable the programmer to create natural interfaces and declarative domain-specific languages in a fraction of time" but I'm not really sure what features it's talking about
The robot module does seem to be a cool library and I like that it has IOT "by default"
I hate the usage of strings here. I think it's important to distinguish between strings and symbols. It makes about as much sense as conflating strings and numbers. String is an abstraction overload well past it's breaking point.
I mean, pretty much all code is just strings subject to certain parsing constraints by the compiler/interpreter/lexer. What GP is talking about is semantic difference, which is super important in programming.
uhhh... no? The difference depends on the language, but really it boils down to semantic meaning behind certain strings. x == y has different semantic meaning than "x == y" but both are literally strings of text.
Well strings in various languages are immutable in many programming languages so that's not it.
In strings I'd say the _content_ matters. If the value needs to be preserved at runtime that is a string, if after compilation the value doesn't, it's only used for binding at compilation time then it's a symbol. So, semantic litmus test I'd propose: if you search and replaced the value and recompiled, would you notice?
I also don't know why. But I like the wording. This can be a new meme for programming language afficionado-skeptics: feature [...] is overloaded past its breaking point. Sent to the demi-gods at the meme ™ registrar office.
There seems to be some interest, so this isn't the best written, but here you go:
Strings are too flexible. They can be used for anything and there should be semantic guard rails to types. Just like you never actually need booleans and enums, you could just use integers for both of those. I have seen developers instead of use strings instead of lists and just comma separate them. Strings are just a collection of characters with no restrictions to them. If you are going to add restrictions make them something else, create a better abstraction. I mean you wouldn't make a database just be nvarchar even if you could, because you aren't capturing semantic intent. Symbols do not have to be preserved at runtime, but do need to align during compilation. I mean should you be able to do string concatenation on a string in an import statement? How about to upper-case on it. If it doesn't behave like a string then it shouldn't look like one.
VHDL, for example, is case insensitive. This means that if I have a simple architecture with a single FSM, and I define a type and a signal for the FSM state like this:
architecture impl of SimpleModule is
type State is (Idle, Busy, Done);
signal state: State;
begin
...
end;
I get an error message for the signal declaration, because the identifier state is already used for the type State. It's easy to fix (for example, using FsmState and fsm_state), but it's just so annoying each and every time.
Also, inconsistency. The example that they put is SHOWLN and showln, and they use all over the place showln, but then they write ReadLN. Driving me cranky :-)
'f' and 'F' are different characters in ASCII, Unicode, or whatever. You have to go out of your way to make them refer to the same thing, and since casing isn't one-to-one for every character, you have to have arbitrary rules: should 'ss', 'SS', and 'ß' be treated interchangeably everywhere?
Grep-ability for one. This would also make Vim's default '*' behavior less useful.
Weird choice, I've programmed in a language that wasn't case sensitive and it's no fun to read legacy code where the casing changes everywhere.
Because naming conventions are important for code reability.
When I look at a piece of code and I see something like "FOOBAR" I can be quite sure that I am looking at some variable in the global namespace. "FooBar" is most likely a class/struct. `foobar` could be a local name or a function.
Sure, these are conventions and don't need to be observed technically, but they are, because they are useful, same as it's useful to name counter variables in loops "i" instead of "localLoopIterationCounterVariable".
Oh and of course there are languages where case actually does matter syntactically, like Golang.
All of that flies out the window in a language that simply ignores case. And it is at this point where I pose the counter-question: What makes ignoring case in a programming language useful?
'a' and 'A' are two different code points. The computer doesn't care about our cultural notation that they are two somewhat-related things. One is `1100001` the other is `1000001"
Therefore they mean, and should mean, different things.
According to the docs (https://dragon-lang.org/documentation#loops), loops may but do not have to use curly brackets around the body (it would seem they use C-style and Lua-style interchangeably).
I can't imagine the reason why would a language designer make this choice, but I would love to hear about it.
> In Oct. 2016 I started the design and the implementation of the Dragon programming language. After 15 months of development, In Jan 2018 the language Interpreter and environment were ready for use!
This shows just how much a labour of love the development of a programming language is.
> The supported programming paradigms are imperative, object-oriented, declarative using nested structures, functional and natural programming.
What is "natural programming" supposed to be?
> Dragon Native
What is dragon native? How does it differ from Dragon? Where is this difference explained? I mean, this is right in the middle of the top thing I see on the webpage.
From the docs:
show and showln operators are used to output text.
What is the advantage of making these operators instead of functions like `printf()`?
From the docs:
readChar(f) - reads one char (2 bytes). Returns number char's code
What is the definition of "char" here? Why is a "char" 2 bytes long?
From the docs:
for initializing, condition, increment {
body
}
// or
for (initializing, condition, increment) {
body
}
// or
for (initializing, condition, increment)
body
end
Why are there multiple ways of writing the same syntactic construct?
From the Dragon native documentation:
Not Case-Sensitive
Since the Dragon native is not case-sensitive, the same program can be written in different styles
In the very next sentence, the documentation states this:
It’s better to select one style and use it in all of the program source code
So why not just enforce a style in the first place?
But it's one thing to emphasize a naming convention, and another thing to simply not compile because I want the function be named doSomething() but am forced to name it do_something(). With a naming convention or an included formatter I still can write my style. At least until I'm used to the language's native naming style.
Being forced just annoys me and keeps me from using the language at all. (Because languages differ here extremely.)
This isn't about enforcing how new things are named, this about enforcing using already existing names consistently.
If the documentation says "there is a thing named foobar", but in the code I can see Foobar, FooBar, FOOBAR, FOObar, etc. used interchangeably, that's not gonna help readbility and maintainability.
I love to see all these new languages coming in with some form of pattern matching. I know some people don't like it but I also am partial to allowing the omission of curly braces in loops/conditionals/etc.
That said, the pattern matching syntax is a little strange and stood out to me. Why does [a::b::c] match an array with three elements? Why does (true, false) match an array with two booleans?
Really hard to take seriously. The writing on the homepage looks so generic it could have been generated by ChatGPT. The example code on the homepage - after lots of talking and babbling - is just one line to print some text.
Even after I saw it has a half-baked custom IDE, I still thought maybe I could give it the benefit of the doubt. "Maybe it has some niche purpose and there is actually some cult/community? Let's check the Community menu link." It was broken.
Where is the github/gitlab/bitbucket link?
Where is the source to even look what it does and how it does?
Also, from the wikipedia page
Some things that Dragon is often used for are:
Desktop applications development
Internet of Things programming
Android applications development
Web applications development
Not one example or libraries provided on how it does that. Because the inbuilt packages for sure do not have many integrations, which make many of things possible in the usecases above.
The website and Wikipedia page look pure marketing rather than any useful info.
Is this just a DSL that calls native libraries of JVM or C??
*Edit: It's worth pointing out that some of the keywords have been changed ('see' has been changed to 'show', for example) but it's basically the same language.
*Edit2: This isn't made by the same creator as Ring, but it was inspired by Ring and uses many of its conventions. It appears to be a direct copy from what I can tell. There's a post in their Google group that mentions it was created by a student in India:
53 comments
[ 3.1 ms ] story [ 120 ms ] threadYeah, I'm not seeing anything super compelling here beyond what, say, Lua can do, but I'm willing to be proven wrong.
https://dragon-lang.org/
https://native.dragon-lang.org/
What is the difference?
Is Dragon open source or free software? I see the MIT license at the bottom of this page: https://dragon-lang.org/introduction
"Tip The language is ready for production!"
Where is it being used in production?
How does Dragon perform compared to Python, Java, C#, or Rust?
Why should I choose Dragon over other programming languages?
But yeah, without seeing any "real" code written in Dragon, makes it very hard to evaluate its ease-of-use.
It doesn't look like it has something that differentiate it from other languages and the main page I feel also doesn't sell it very well
It does say that it offers "features that enable the programmer to create natural interfaces and declarative domain-specific languages in a fraction of time" but I'm not really sure what features it's talking about
The robot module does seem to be a cool library and I like that it has IOT "by default"
I hate the usage of strings here. I think it's important to distinguish between strings and symbols. It makes about as much sense as conflating strings and numbers. String is an abstraction overload well past it's breaking point.
One of my favourite things about the language in fact.
In strings I'd say the _content_ matters. If the value needs to be preserved at runtime that is a string, if after compilation the value doesn't, it's only used for binding at compilation time then it's a symbol. So, semantic litmus test I'd propose: if you search and replaced the value and recompiled, would you notice?
Strings are too flexible. They can be used for anything and there should be semantic guard rails to types. Just like you never actually need booleans and enums, you could just use integers for both of those. I have seen developers instead of use strings instead of lists and just comma separate them. Strings are just a collection of characters with no restrictions to them. If you are going to add restrictions make them something else, create a better abstraction. I mean you wouldn't make a database just be nvarchar even if you could, because you aren't capturing semantic intent. Symbols do not have to be preserved at runtime, but do need to align during compilation. I mean should you be able to do string concatenation on a string in an import statement? How about to upper-case on it. If it doesn't behave like a string then it shouldn't look like one.
Why would I ever need foo, Foo, and FOO to refer to completely different things?
someMock = SomeMock()
Also, inconsistency. The example that they put is SHOWLN and showln, and they use all over the place showln, but then they write ReadLN. Driving me cranky :-)
When I look at a piece of code and I see something like "FOOBAR" I can be quite sure that I am looking at some variable in the global namespace. "FooBar" is most likely a class/struct. `foobar` could be a local name or a function.
Sure, these are conventions and don't need to be observed technically, but they are, because they are useful, same as it's useful to name counter variables in loops "i" instead of "localLoopIterationCounterVariable".
Oh and of course there are languages where case actually does matter syntactically, like Golang.
All of that flies out the window in a language that simply ignores case. And it is at this point where I pose the counter-question: What makes ignoring case in a programming language useful?
'a' and 'A' are two different code points. The computer doesn't care about our cultural notation that they are two somewhat-related things. One is `1100001` the other is `1000001"
Therefore they mean, and should mean, different things.
I can't imagine the reason why would a language designer make this choice, but I would love to hear about it.
This shows just how much a labour of love the development of a programming language is.
https://suif.stanford.edu/dragonbook/
What is "natural programming" supposed to be?
> Dragon Native
What is dragon native? How does it differ from Dragon? Where is this difference explained? I mean, this is right in the middle of the top thing I see on the webpage.
From the docs:
What is the advantage of making these operators instead of functions like `printf()`?From the docs:
What is the definition of "char" here? Why is a "char" 2 bytes long?From the docs:
Why are there multiple ways of writing the same syntactic construct?From the Dragon native documentation:
In the very next sentence, the documentation states this: So why not just enforce a style in the first place?This always seems like a good idea until many people start using it different ways
There’s a reason tons of languages from python to zig all have said they want “only one way of doing something”
Being forced just annoys me and keeps me from using the language at all. (Because languages differ here extremely.)
If the documentation says "there is a thing named foobar", but in the code I can see Foobar, FooBar, FOOBAR, FOObar, etc. used interchangeably, that's not gonna help readbility and maintainability.
That said, the pattern matching syntax is a little strange and stood out to me. Why does [a::b::c] match an array with three elements? Why does (true, false) match an array with two booleans?
Some things that Dragon is often used for are:
Desktop applications development Internet of Things programming Android applications development Web applications development
Not one example or libraries provided on how it does that. Because the inbuilt packages for sure do not have many integrations, which make many of things possible in the usecases above. The website and Wikipedia page look pure marketing rather than any useful info. Is this just a DSL that calls native libraries of JVM or C??
https://native.dragon-lang.org/documentation/variables.html
https://ring-lang.github.io/doc1.17/variables.html
*Edit: It's worth pointing out that some of the keywords have been changed ('see' has been changed to 'show', for example) but it's basically the same language.
*Edit2: This isn't made by the same creator as Ring, but it was inspired by Ring and uses many of its conventions. It appears to be a direct copy from what I can tell. There's a post in their Google group that mentions it was created by a student in India:
https://groups.google.com/g/ring-lang/c/Rqm4jI_TV1s/m/SmWL7r...