The Dragon Programming Language
dragon-lang.org
dragon-lang.org
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...
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?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.
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.
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"
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??
Yeah, I'm not seeing anything super compelling here beyond what, say, Lua can do, but I'm willing to be proven wrong.
This shows just how much a labour of love the development of a programming language is.
I can't imagine the reason why would a language designer make this choice, but I would love to hear about it.
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?
Why would I ever need foo, Foo, and FOO to refer to completely different things?
function Foo.bar(foo, foo_param)
foo.buxx = foo_param or FOO
return foo
end 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.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.