Dart Is Not the Language You Think It Is
An anonymous reader writes "Seth Ladd has an excellent write-up of Dart: 'When Dart was originally launched, many developers mistook it for some sort of Java clone. In truth, Dart is inspired by a range of languages such as Smalltalk, Strongtalk, Erlang, C#, and JavaScript. Get past the semicolons and curly braces, and you'll see a terse language without ceremony. ... Dart understands that sometimes you just don’t feel like appeasing a ceremonial type checker. Dart’s inclusion of an optional type system means you can use type annotations when you want, or use dynamic when that’s easier. For example, you can explore a new idea without having to first think about type hierarchies. Just experiment and use var for your types. Once the idea is tested and you’re comfortable with the design, you can add type annotations."
Those people always bitch about and those no one uses.
Since I have yet to hear any complaints about Dart, I can only assume it's in the latter category and no one cares.
the D
I've been doing this with comments since 1999 and it works great! Of course I still haven't gotten around to that final step of going back and adding all those comments but I love the flexibility!
Unless you like bugs, type-checking is a good thing. Lack of type enforcement encourages what -- lack of forethought?
not having heard of it, and thus never having any thoughts about it, and since you say it's NOT what I think it is (nothing), I guess Dart *is* something!
It sounds like somebody's language is on the chopping block at google. Dart has had a long, quiet run and Google seems to be allergic to that these days.
Can't wait' for the day when all languages 'evolve' back to Lisp.
Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
I've been following Dart on and off since it's announcement. I'm still a little skeptical of the language, but I'm a fan of what they want to do. Here are their basic goals:
There is a lot more to it than this, but it's sort of a beginning. The language still hasn't hit 1.0, so no one is seriously using it (as the language itself was seeing large changes up until recently). Google has not talked about anyone outside of the Dart team itself that is using Dart within Google (they are doing it, it's just not being talked about yet).
Since 1.0 is expected this summer, you probably won't see many people using it until that milestone is hit. Once 1.0 is hit, people will be more willing to create real products with it, so you can expect to see more about Dart after that. As well, once the DartVM makes its way into Chrome (which will happen sometime after 1.0), you'll probably see a lot of press about the first Google App that is written in Dart.
It's still early in Dart's life. The only people really seriously using it are people that like learning new languages. Companies and most developers won't touch an in-progress programming language out of fear that syntax and behavior changes will screw them up.
Its not what it is, its something else.
GWT, or DART?
Get ready to hear some bitching about Dart on this thread, then review your assumption.
I vote for no one cares.
I for one never encountered a situation where I thought "gee, if only I could prototype without types!". Types matter. When solving even the most basic data processing problem there's "input" and "output". Specifications are very clear on the formatting and types. What happens in between is dictated by those types.
Typeless programming in shorthand for lazy markup.
Or so that was my first thought. Then I got to the end of the article
Dart compiles to JavaScript and runs across the modern web
And suddenly I find it potentially very useful. I have a NodeJS project to develop a Streaming Service later this week. While I was planning on writing it in Coffeescript, the classic OO nature of Dart with Type Checking and Interfaces(!) seems like a potentially better match since the NodeJS app will be a clustered streaming service -- just the sort of application whose architecture could greatly benefit from these language features. If that succeeds, I know of a large retailer wanting to create a NodeJS middleware as a REST API to legacy systems, who might find Dart as compelling as I do.
I fooled around with Dart a few months ago. I like the language. But I really want to be able to use it AND all the javascript libraries that do lots of work for me. It's my opinion that it will be hard for Dart to get traction if all those libraries have to be rewritten.
Dart understands that sometimes you just don’t feel like appeasing a ceremonial type checker.
Given that in Dard, the type checker is only ceremonial as far as I can tell, this is an interesting choice of words. The purpose of a true type checker like you find in Haskell, Agda, ML, ATS, etc. isn't just ceremonial. It guarentees certain properties of the resulting program (e.g., that variables of a certain type actually contain an object of that type, that you can never apply an invalid operation to an object, etc.). That is far from ceremonial.
Why they recreated Ecmascript 6 is beyond me. Seems a huge waste of effort when they could have focused on implemented Harmony more quickly in Chrome/Blink/Webkit, and evangelizing that instead.
Yet another scripting language. Oh boy, because Perl, Python, Ruby, Lua, and probably a hundred others I've never heard of just don't give you enough chaos (oops, I mean choice). Or there is some reason that Dart is the scripting language to end all scripting languages. Or it's an optimal combination of the best features of 47 other languages. Whatever.
Isn't that just Visual Basic 6, VBScript, JScript, ActionScript, Real Basic, Jabaco, or JavaScript/ECMAScript? There are languages out there and even C# has the dreaded 'var' in it as well. I just don't see Dart's use outside of Google products.
You say things that offend me and I can deal with it. Can you?
Apparently the real reason to include Big Integers was to make it an attractive language for dollars and cents... for instance this commit came from financeCoding/master.
Exciting stuff...
"Just experiment and use var for your types. Once the idea is tested and you’re comfortable with the design, you can add type annotations." Riiiight, because all developers you know do that. It's never about "just do something that works and then move onto something else"... Nope, doing things properly always happens. And it especially happens on the projects that matter.
I haven't used DART yet, so I will not comment on the strength or the weakness of it
But, all through the decades that I've been in the scene, there have been so many programming languages invented, but so few of them being used
Some of the more widely used programming languages like C, for instance, are not perfect, but they are being used partly because of legacy, partly because of momentum, and partly because of the laziness of programmers to learn new, more useful languages
Talking about legacy, the other day there was a piece on Cobol, and that IBM is trying to extend Cobol to the cloudsphere
As for the languages that are not so-widely used, some of them are downright weird, but then, there are gems among them. The only downside for those few gems is that the ecology is not there to enable those few gems to become more widespread
I guess it's kinda Darwinian game plan --- not all surviving/thriving species are perfect, and not all the extinct species are bad, either
Muchas Gracias, Señor Edward Snowden !
They are like Pop tunes. All vaguely the same but different. Empty and useless. Without purpose other than to be Yet Another Language.
That's what I think. ActionScript allows the same static/dynamic switch:
for(var i:int = 0; i < 0; ++i) { }
for(var i = 0; i < 0; ++i) { }
But, in strict mode, it will give you warnings for the 2nd.
The G
And then there's Python.
I know Tom Magliozzi used to wax rhapsodical about his old Dodge Dart from the 1960s; and recently Dodge resurrected the brand.
So yeah - there are people that care deeply about Dart.
#DeleteChrome
Dart knows that you don't have time for strict typing. Unless you do. For example, Dart allows you to write code. And that's just one example. Once your code is done, you can add more code that doesn't do anything. Unlike other languages, Dart allows you to define functions and libraries, not just classes. Go ahead, write free functions and import them into your programs. See if Dart cares. Unlike any language in history, Dart also has anonymous functions. What's that function's name? Dart doesn't have to tell you.
I'll support it. Javascript is a thoroughly horrible language with anachronistic syntax that requires specialised skills to understand. If Dart has the potential to rid my life of Javascript, please Google .. get it out there!!
I'm not sure why you were modded Troll. I tend to agree. Types are no good if they are not enforced. Either use a language that doesn't enforce typing or use one that does. This in between approach is indeed lazy.
One Problem is teaching.
One problem is "compatibility" or "easy to learn". E.G. regarding keywords.
C has a keyword: static.
C++ has the same keyword: static.
As Java aimed to be similar to C++ and "easy to learn" it also has a keyword static.
While the meaning of the "keyword" in Java and C++ is the same, it differs from C. (Oh! and this already is not true as you can use 'static' in C++ similar to C if you just use it for free functions and data).
So what does 'static' mean?
http://dictionary.reference.com/browse/static
http://www.thefreedictionary.com/static
http://www.merriam-webster.com/dictionary/static
http://oxforddictionaries.com/definition/english/static
Unfortunately 'static' in a programming language has no meaning at all. Why is the "starting method" in Java called "static void main(String[] args) {}"? Yeah, because in C and C++ it is called main(). Pascal has not that problem.
What do you think a non native english (oh, well what about the english?) considers if he hears the word 'static'?
Good, now lets bash Python and Groovy. What is a "def"? Oh? A definition? Are you certain you can distinguish what the difference between a definition and a declaration is?
So "methods" are now "declared" (or is it defined?) by the introducing keyword "def"? Oh, for fuck sake, I got it wrong again.
Oki, in Python you declare, oh no!!!! you define methods with the keyword "def". In Groovy you define variables (oh! no!!!!! you declare!!!) with the keyword "def".
Yeah, I could rant forever ...
All new languages we see here and there are only languages for programmers that already can program.
But, what is about expressing your mind?
What about teaching programming? Imho Java is one of the most difficult languages to teach. Why? Because you need to know already so much about programming to grasp it!!!!! (Same for C# ofc).
However: modern times show: you don't need to understand Java/C# (just a replacement for most modern languages) because the programing tasks a modern developer has (especially compared to the tools he has at hand) is so mondane. C++ on the other hand only shows how super smart and knowing you need to be to use the language, or not to shoot into your foot.
So where are we?
New languages should use new keywords, that describe precisely what they mean. No void, no static, no final or for that matter finally, no fucking def, var or func. Did I forget one? I certainly did. And they should have reasonable defaults. I hate Java meanwhile, "public void doit() {}", "private boolean done = false". Then we get to "static final String DID_WE_DO_IT = "yes we did";" What is so hard in having methods be PUBLIC by DEFAULT and attributes PRIVATE by DEFAULT? ... neither C++ nor Java nor C#. The redundancy hurts me literally.
Writing code is still possible, even if it hurts my hands and my eyes. But reading? I simply don't want to read code anymore
In a typical Eclipse window I would estimate 30% of all characters/words are simply superfluous. And the fact that they all have a different colour emphasizes this.
How would a real world language look to you if it was written like this: "I want (that is me the guy writing) that we (that is us, you who are listening, and me who is talking) that we (well, dont be mistaken, I only want it, it is not an order) that we (yes, I invite you to participate) go to the beach (and want does not mean it is super important ... it is kinda void)? (And all words in () above in a different colour? Like pink (ARRRRGGG!!!!) light green ( /*facepalm*/), dark and light blue, emphazised(bold) full
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Yeah, exactly. What the writeup calls "appeasing a ceremonial type checker" is more properly called "debugging".
Don't get me wrong, I like the thrill of the chase, the satisfaction of tracking down a really hard bug, as much as anyone. But I like programming even more. Using a well-designed type checker, I can find bugs in my program and convince myself that I'm programming rather than debugging.
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
I like what I read. I'm always conflicted by my good experiences with untyped languages, compared to my good experiences with typed languages finding hard to find bugs. It's nice to see people looking at how they can be mixed. And I like they've added some stuff that Java lacks which is useful. (no such method) etc.
The trouble is: it looks too much like Java for it to be likely that anybody will bother. With all languages I usually end up thinking... is this as elegant as Scheme? No? So why bother. I think even CLOS type schemes can have the compiler do type checking, so what do we gain? Has anything ever surpassed Scheme plus whatever favorite libraries, or macro/ object collections you like? I don't think so. Scheme allows you to overlay pretty much anything onto its syntax. It always seemed like the final word to me.
For those of you who don't know, asm.js is a subset of JavaScript that's meant to be easy to compile. In other words if you use asm.js the code your will work in all browsers, but should run faster in some. In that FAQ they say their compiled asm.js runs at about 1/2 the speed of C, making it roughly twice as fast as JavaScript V8.
Which is wonderful, except that JavaScirpt is a prick of a language, and so I'd imagine that asm.js is a tedious, prick of a language. But Dart compiled to asm.js - sounds like a marriage made in heaven.
No type checking means worst code and more bugs.
yet another language?
Greed is the root of all evil.
Wait a minute. I'm a programmer BECAUSE I'm lazy.
And then there's Haskell. A language people always *praise*!
(Also, Erlang seems to have a pretty good reputation.)
Sorry, only C-likes, with their shitty outdatedness and fuck-ugly aesthetics, get that constant bitching.
Yeah... that of course includes Dirt^WDart
No more public-static-void-main-String[]-args just to start a program! Dart’s simple top-level main() function is all you need.
...Is this actually a deal breaker for some people in other languages?
Java slave here. If I want to be lazy, I just put things in a Map. I know it's evil. EVIL. Typing is not just for you, it's for all those who come after you. It's documentation.
I find complex Javascript almost unreadable and hard to maintain.
Another piece of fluffy, superfluous tech from Google that will receive a lot of praise, while the competitors superior solutions that actually solve problems get negativity because they're not Google's tech.
Why Google always reinvents the wheel (this is just Ecmascript 6 without backward compatibility) and doesn't just use something that's proven (like Lua) is beyond me. Maybe not-invented-here syndrome.
I love how they continuously invent new tech on a whim and say it's a "standard", like Pepper, NaCl, WebM, et al, while ignoring other actual standards that fit the bill for YEARS just so when they reinvent it, people will say Google did it.
Return a list from a function. Sure, you can legally do it, there's nothing in the language inherently stopping you, but experienced C programmers will avoid returning a list at all costs, because suddenly you have to care about whether the caller frees the list properly, and what if the things in the list are used elsewhere and we need to do reference counting etc.. etc... I've worked on a C codebase that was a couple hundred thousand lines of code, and I can't think of anywhere that we ever returned a list from a function. I can't think of any Haskell program more sophisticated than "hello world" that I didn't use "map" and other list functions all the time.
Ultimately, the cost of manual memory allocation isn't just the extra work you have to do to make sure you aren't leaking or corrupting memory, it's the algorithms you won't allow yourself to even consider because the memory management would just be too hard.
I'm not saying C doesn't have it's place, I'm just saying that there are software engineering costs associated with using C as opposed to a higher-level language.
"Just experiment and use var for your types."
:) ) I have yet to get to a point where I would choose a language _because_ I'd prefer those "var"s. Most things have a reason, and I've always thought of these dynamic type languages (with some exceptions of course, where you can't really do anything else) to target average people who don't want to deal with much, and who don't really create complex code. I wouldn't mind if all the world's sticky note apps would be written in Dart. Or whether checker apps. Or news ticker apps. You get my point. Otherwise, keep them out of my sight.
Well. I've been coding since I've first saw a computer (well, maybe with a few weeks delay
I am putting myself to the fullest possible use, which is all I can think that any conscious entity can ever hope to do.
And then there's Python.
people bitch about python. at least I do.
whitespace has effect. who has time for that..
world was created 5 seconds before this post as it is.
Those people always bitch about and those no one uses.
Since I have yet to hear any complaints about Dart, I can only assume it's in the latter category and no one cares.
We need these languages, not necessarily for working with them, but to inspire others. The experimental languages of the 60's and 70's begat Smalltalk, which influenced C++ and Objective C, they all lead nicely to Java and C#.
All of these influence the current batch of experimental languages.
What I want is the beauty of Smalltalk, the rapid development of Python, the library depth of Java, the speed of C++ and the pervasive platform of javascript.
If I could do web-client side scripting in a language like that I'd be happier than a pig in shit.
Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. While some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do.
XML is a known as a key material required to create SMD: Software of Mass Destruction
And then there's Python.
people bitch about python. at least I do.
whitespace has effect. who has time for that..
Same, but it's almost my only complaint. Other than that it's an elegant language, my favorite for scripting.
XML is a known as a key material required to create SMD: Software of Mass Destruction
Yeah, exactly. What the writeup calls "appeasing a ceremonial type checker" is more properly called "debugging".
Don't get me wrong, I like the thrill of the chase, the satisfaction of tracking down a really hard bug, as much as anyone. But I like programming even more. Using a well-designed type checker, I can find bugs in my program and convince myself that I'm programming rather than debugging.
Agreed. The languages I've used the most would be Smalltalk, C++, Javascript and Java (in rough chronological order, some overlaps), two are weak typed two are strong typed.
After a day grinding out hundreds of lines of productive Java trying to do anything in javascript just makes me want to drown kittens... well perhaps kittens named Brandon Eich. (Sorry Brandon... I've just seen too many sins committed with your language.)
XML is a known as a key material required to create SMD: Software of Mass Destruction
I found one statement interesting in the description of the language:
"Dart compiles to JavaScript"
How many other high-level languages do that?
Yet another programming language for lazy developers..... .NET framework) it was about 40%!!!! faster on average, which would mean an older device would run the same stuff just as good as a newer device with the current android, something tell's me it's a waste of my money to buy a faster device..
There are already too many flavors of developmentlanguages, everybody wants his/hers to prevail and is trying to come up with reasons why their language is better.. stop this BS.. looking at a lot of those 'spinoff' languages I mostly see stuff added in comparison to the 'standard-languages' which are clearly for lazy developers who don't know (or want to know) what they are doing.. And in the end all we end up with are slower applications even though our hardware is getting faster and faster, but due to the slow applications we hardly notice it when we upgrade hardware and software.. A great example is Android, when ported to C# (which already is also a 'slower' language/compiler as using real native compilation without a
but then again, there are enough people who just don't give a damn..
The article mentions that you can leave types aside for a moment, when you want to rapidly develop something.
That's the worst programming advice ever.
Good design starts from typing.
Is this just a fancy term for an interpreter?
Or return a function from a function?
"Dart ..."
You keep using that word, I do not think it means what you think it means.
You can treat any object-oriented language, such as Java, as an untyped/dynamic language by declaring all your variables, method parameters and return values "Object" and not using generics. It doesn't save you the typing, but the result is mostly the same. Of course, it won't allow you to do fancy Python stuff such as dynamically adding methods or values to existing objects, unless you want to get fancy with maps.
That must explain why so much software sucks these days, as well as all the binary bloat. Now get off my lawn.
Return a list from a function. Sure, you can legally do it, there's nothing in the language inherently stopping you, but experienced C programmers will avoid returning a list at all costs.
Hmm, that's odd. So C has its place but it's avoided because it lacks garbage collection? My C code has automatic garbage collection and OOP facilities. It's got lists and maps, and a comprehensive collections library. It's just under 30 thousand lines of code, but then it's just a game engine. It only has to do everything the computer actually can. If you don't have these basic facilities in your C library, it's your own damn fault. Seems to me if I want I can always have it in C, there's no excuse for not having it.
My memory manager replaces the malloc / free facilities, so it can even be added to other C code-bases, hell, I use it in C++ code because it's faster than the GC in the standard library (for the way I use it). So it's not like I have to call reference counting functions; Just the GC_recycle() function, or enable it to run automatically, which blocks on malloc() / free(), and optionally gives each thread their own local GC rather than a unified approach such that part of the program can garbage collect while another keeps running.
However, when my testers bitch about stutter in Java / Android No matter how badly I want Java or JavaScript to give me control of the damn garbage collector, so it doesn't run in the middle of the rendering loop or intense action sequence, I can't have it. I have to implement an object cache atop Java and pre-allocate everything, try my hardest not to give the GC a chance to run, and if I slip up once and let that fucker have control, it's game over, literally, when the enemy attacks and the game lags for half a second.
I return lists from functions all the time you dumbass. I'm an "experienced C programmer". Stop painting with such a wide brush, you're getting the paint in you eyes.
An AC adds:
Or return a function from a function?
I throw Function pointers around like crazy, that's how efficient state machines, decision trees, or other flexible structures are formed. Hell, my Entity-like system allows Actors to composite sets of functionality as it transitions states to create efficient AI -- Just because it's fleeing doesn't mean it's still not searching for Health. It would be like if C++ let you pick which methods you inherited from multiple parents on the fly. I mean hell, returning and passing a function pointer is how I implemented multiple sorts:
// or
list->sort( list, list->getSortRoutine( SORT_MERGE ) );
myCustomRoutine = getCurrentSort();
list->sort( list, myCustomRoutine );
That first "list" being passed in the sort function pointer invocation is where your magic "this" pointer comes from in C++.
So then YOU take responsibility for the list.
ListHandle* l = createList();
if(l) {
someListPopulatingFunc(l);
useList(l);
destroyList(l);
}
Nimrod is a much more capable language, and supports generating C/C++/Javascript as backend languages, too.
You could write your own garbage collector for the JVM, which gives you 100% control over when, where and how to GC.
There are way too many programming languages, and the industry is already too Balkanized. We don't need a Google language too. Every company has to have their language, and everyone in open source wants to be the next Larry Wall or Guido. What happened to industry standards? Every language does more or less the same thing. Yet we have C#, Objective-C, C++, Java, Perl, Python, Ruby, Lua, PHP, and so on - all of them are basically the same, but different. Cognitively, it's difficult to even remember which language I'm using. I'd almost rather use C, LISP, FORTH, and REXX because at least they're DIFFERENT and not all the same but slightly different.
How do you find the length of a string?
strlen()
length()
string.len
string.length
string.len()
string.length()
???
Sometimes I just sit at my desk, wondering which language I'm using at the moment and how to do the simplest thing.
We need to return to INDUSTRY STANDARDS - pick a language or two and enhance them, not create new languages.
Every company has an ORM tool. (Core Data, Entity Framework, Hibernate etc) All of them do the same thing, but differently.
Every company has one (or more) MVC framework. All of them do the same thing, but differently.
At first glance I thought it said, "Shart, it's not what you think it is!"
Instead of writing a new language because programmers are lazy, wouldn't it be easier to just hire good ones to begin with?? Or to offer a class that teaches them to type???
As a user of many different languages over the last 3 decades, I have always preferred the ones that require me to think about data types. In those that didn't force types, I found that things went a lot smoother if I used them anyway, or activated a switch that did require it.
In my experience, if I didn't understand what data type I needed, even if it's just 'Object', I didn't understand what I was doing anyway.
Think before coding, it saves a lot of time later because you don't have to rewrite as much shit.
I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
Sometimes the type system gives more overhead than safety. A wonderful satirical example in Java: https://github.com/Mikkeren/FizzBuzzEnterpriseEdition
/* actual code I want to test */ } " and either put Imports at the top or use fully qualified package names. So the equivalent "fast try something out" I do with Python still takes four times as long.
You also have to weigh developer feedback time. I've developed web applications with Java Struts, coding directly to the Java Servlet API, Play Framework 1.x, and Play Framework 2.x (in Java, not Scala), and Python with Twistd. In order of speed of development of correct (i.e. in production without known bugs) code, they are from fastest to slowest: Python with Twistd, Play 1.x, Play Framework 2.x, Java with the Servlet API, Java Struts. Play Framework 1.x and Python give you instant reload. You save your changes, hit F5 in your browser, and see your change immediately. Anything I built without that takes three times as long. Play Framework 2.x doesn't have it, because under the hood Play 2 uses Scala and at least on my machine, best-case-scenario a Scala recompile of modified files after I change some Java file takes 5+ seconds. With Struts and just using the Servlet API, I have to reload the damn application and that's 10 seconds or longer. It seems like a trivial thing, but it's huge.
I'd say hot reload brings Java on par with Python for development, except Python has one extra feature: the REPL. "How does X work?" type.. "Oh, that's how it works", go back to coding. With Java, even in an IDE it's "create a public static void main (String [] args) throws Exception {
There's a reason that Google and Facebook and Twitter all use C++ and Java behind the scenes. But there's also a reason millions of sites use PHP, Python, Ruby, and Perl up front - because the development speed is so fast that you're into your testing (and unit tests) in a third the time of the Java version. So if your Java build takes three weeks of coding the application and one week of coding the tests, and your scripting language version takes one week of coding the application and two weeks of coding the tests (to offset the weaker type system), you still get to market faster with the scripting language.
Maybe the ideal is something like Perl6 (which has optional typing but does enforce type constraints when they're listed) or Groovy (which you can convert to Java more or less as-is once your rapid development phase is over).
Go get Hy. https://pypi.python.org/pypi/hy (Python in a LISP-y syntax. Same libraries, same features, no whitespace worries - but the project is still in alpha.) Why should Java developers have all of the LISP fun with Clojure?
Same here, except that it annoys me to the point where I don't use it. Too bad Python doesn't have a CLI switch to turn on braces instead of spaces.
When the FUCK can we get rid of end of line semicolons and the ugly curly braces?
If we need new symbols to designate concepts, then let's create a font for them and map them on to a keyboard.
But really, those chars simply need to die.
- Zav - Imagine a Beowulf cluster of insensitive clods...
Seems to me there is all of **one** browser based programming languages in common usage. And that one language has some very serious defects which, practically, cannot be fixed.
Is "DART" from Dartmouth?
Instant reload is important when you are programming by trial and error!
It helps bad programmers to indent their code :)
I'm so glad I get to use this legacy software!
Said nobody ever.
Same here, except that it annoys me to the point where I don't use it. Too bad Python doesn't have a CLI switch to turn on braces instead of spaces.
I am reminded of a university professor who was supposed to be teaching C/C++ to first year Comp. Sci. and spent most of one of the first lectures demonstrating that you could basically write Pascal instead and leverage the pre-processor to generate C at compile time.
XML is a known as a key material required to create SMD: Software of Mass Destruction
I've really only got two complaints with Python3:
1) It's too slow.
2) It's too hard to write fixed length blocks of data to disk.
Both of these could be addressed with optional typing, but I don't expect that to ever happen, because the trend is in the opposite direction. OTOH, any year now I expect Vala to become usable.
I think we've pushed this "anyone can grow up to be president" thing too far.
sometimes you just don’t feel like appeasing a ceremonial type checker
When strong type checking becomes a "way of life" for a programmer, it's not a burden. It causes certain tasks to take a little bit longer (such as typing in the code), and it makes other tasks much, much easier (such as automatically eliminating a whole class of nasty bugs).
If you use strong type checking all the time, then you'll learn how to use it quickly and efficiently. Once you reach that point, it would never occur to you to not use it, because you have years of experience knowing that it makes you more productive.
If you aren't using type checking that way, then you're doing it wrong.
On 1) PyPy is MUCH faster. Unfortunately, it's only for 2.7 right now, but pypy 3k should be here real soon. It *WILL* solve that problem for you.
On 2) I suppose I can imagine that, never tried it.
But:
3) Memory overhead per object
and:
4) Lack of decent multithreaded performance
are the real Python limiters for me. Not killers, though; there are still plenty of use cases where Python is leader of the pack.
First, what does it provide that no other language does, or does very, very poorly, enough to make an employer want to switch?
Second, "Just experiment and use var for your types. Once the idea is tested and you’re comfortable with the design, you can add type annotations.".
ROTFLMAO!!!!!!!
Translation: it actively encourages lazy, bug-ridden code, and no, NO ONE will *ever* "go back and add type annotations". Won't happen.
mark
Instant reload is priceless when you're building something incrementally. Add this field to the database query. Add that block to the page. Add this validation to the function inputs. Add that reference to a third party library. etc... etc...
And yes, trial and error. But if a strong static type system was inherently superior to trial and error, all Java and C# production code would be bug free, right?
I never said there was anything wrong with trial and error. In a manner of thinking, it is how everything gets done one way or another.
My brain just has a hard time not giving a fuck about types, because at the end of the day type does matter. It matters whether your language helps you to remember or not, regardless of if you discover type errors at run time or compile time. Personally, I just like a little help.
I'm so glad I get to use this legacy software!
Said nobody ever.
Nor did I. I just pointed out, and rightly so, that a lot of software these days suffers from enormous bloat and lack of optimization.
I want to se your C code for this simple Haskell function:
f x y = x*y
When applied to just one argument:
g = f 5
You get back an one argument function that will multiply by 5:
g 4 equals 20.
h = f 10
h 4 equals 40.
Your task is to write a C function, that does not memory leak (although it is hard enough even if you are allowed to leak), that based on some parameter will return a another function that is different each time. Like in the above Haskell code, I shall be able to invoke your C function multiple times, for example with the values 5 and 10 and get back new functions that will multiply with 5 and 10. The later must of course not override the behaviour of the former.
I'm so glad I get to use this legacy software!
Said nobody ever.
Nor did I. I just pointed out, and rightly so, that a lot of software these days suffers from enormous bloat and lack of optimization.
But if it does the job, and it's fast and useful on modern hardware, who cares?
If you happen to listen to the Security Now! podcast, Steve Gibson usually complains every week or two about Chrome taking up more and more memory---like a whopping 250 MB---to display a single window with an empty tab. To that, I say back: I'm having trouble giving a flying fuck about a quarter gigabyte of RAM when EVERYTHING on my system can't even seem to gobble up HALF of the 16 gigs I have. And that's on Windows. With superfetch.
If the code runs well on a modern system, and it allows programmers to focus on performance by being lazy with memory, what the hell does it matter? This isn't 2005. People figured out that RAM is an important statistic in the computer they want to purchase, and OEMs started realizing that if they DOUBLE the memory in a computer for a pathetically small amount of money, it turns out that their products won't be titanic piles of shit.
Programmers are starting to realize that they can offload their sloppiness to memory management and focus on CPU cycles. If Chrome is the shining example of why that's a good thing, then personally, I think we're doing something right!
Perfect code isn't impossible, it's just a ton of time, work, and money. There's nothing wrong with shuffling the budget to take advantage of the realities of today.
Boot Windows, Linux, and ESX over the network for free.
http://en.wikipedia.org/wiki/Ratfor
The next question is why and how did C++ move from a preprocessor to become one of the big boys?
The part that I find interesting is how far JS has taken the WEB. Especially given the flaws in JS. Further the serious security tangle on the WEB that even Java does not get right begs improvement at many levels and Dart seems to be a necessary stepping stone.
Truth is stranger than fiction, but it is because Fiction is obliged to stick to possibilities; Truth isn't. Mark Twain.
I think the ideal is a type system that is flexible enough not to restrict your design and also compiles so quickly that it doesn't slow your development. Again, I'm using examples I've personally encountered - Java and Scala (strong static typing) vs Python and Clojure (runtime typing). In those cases:
1. Java compiles fast, but the type system gets in the way and you end up writing tons of boilerplate/logistical/Design Pattern code to work around it.
2. Scala has an awesome flexible type system, but the compiler is painfully slow and you spend time waiting for compilation to finish.
3. Python and Clojure basically run instantly, but of course you get type errors at runtime. The key thing is, you get most (but not all) of the errors immediately, so you can fix them right away.
Maybe something strong but very flexible type system but with fast compilation works better - maybe Haskell, or D, but I've never used any of them to write more than the simplest toy applications.
My impression is that the appeal of weak typed languages is mostly in the ability to readily convert between primitive types. The gratuitous code created by maintaining multiple variables, for example a string and a long, and having to convert between them, while handling the exception they might throw, is truly one of my most hated programming activities. I wonder though, if one is truly forced to use a scripting language to have this feature? Would it not also be possible to provide a "dynamic type", or "super primitive", that could implicitly be used anywhere that another primitive is used? If it threw an unchecked exception, it would just die suddenly and catastrophically like a scripting language... so nothing really different.
Don't ask why, but I have extensive experience programming with a language which is now called, "ASP Classic". It had an option to at least force you to declare the names of variables ("Option Explicit"), which turned out to be absurdly handy. Figuring out what was happening when you had a variable, someVariable, and the same thing, someVairable, could take hours... because there was no exception, just poorly functioning code. I hate languages where variables can appear out of nowhere, that feature should not exist anywhere.
What I am trying to say here is, why not provide strong types when it matters, and weak types for when it does not? This whole debate feels like it is between people on different planets, like it is some ideological thing with no compromised solution.
OK.
PyPy might be fast enough, but I've never benchmarked it, and definitely not the version for Python3.
FWIW, it's possible to write fixed length data records in Python (including Python3). It's just a real nuisance.
OTOH 3 might be a real problem, if I got far enough into a project in Python. So far the kind of project where that would be a problem has washed out earlier on other grounds.
As for 4: Nobody seems to do multi-threading well. Python's only a bit worse than others. It's gotten to the point where I write things as multi-process instead. With ANY virtual machine, that means a lot of overhead when starting things up, and a lot of continued RAM overhead. So you avoid starting processes frequently by using something analogous to threadpools, and communicating by message passing. (There's a couple of languages that handle this aspect better, but they have other problems.)
So 5) There is no perfect language. You choose the language(s) for the project. Python3 is one of the languages that I more commonly choose. D (dmd) is another. Vala is a language that I keep my eye on, because it shows a LOT of promise. But it's been promissing for years, and every time I've tried it, there's been major problems. (I feel the run-time error messages merrit the description I've heard: "encrypted Klingon".)
I think we've pushed this "anyone can grow up to be president" thing too far.
Not just the => stuff. And I haven't compiled Ada in twenty years but when looking at Wikipedia for dart examples I just got that feeling. Also Ada is a strongly typed language. Dart seems to have type options.... ??? Need to study further.
Your Haskell probably translates what you're doing into something like this:
(I admit it can be written more elegantly in C++ using templates and operator overloading)
#include
typedef int (*FN2)(int, int);
struct delegate_fn2_1arg
{
FN2 function;
int arg1;
};
int call_fn2_1arg(struct delegate_fn2_1arg *s, int arg2)
{
s->function(s->arg1, arg2);
}
int f(int x, int y)
{
return x * y;
}
int main(void)
{
FN2 fptr =
struct delegate_fn2_1arg g = { &f, 5 };
struct delegate_fn2_1arg h = { &f, 10 };
printf("f(6, 7) = %d\n", fptr(6, 7));
printf("g(4) = %d\n", call_fn2_1arg(&g, 4));
printf("h(4) = %d\n", call_fn2_1arg(&h, 4));
}
I've really only got two complaints with Python3:
1) It's too slow.
2) It's too hard to write fixed length blocks of data to disk.
Both of these could be addressed with optional typing, but I don't expect that to ever happen, because the trend is in the opposite direction. OTOH, any year now I expect Vala to become usable.
Slow compared to what? Other scripting languages? Native binaries? Or jits like Java, C# ?
XML is a known as a key material required to create SMD: Software of Mass Destruction
To my mind there's no point in benchmarks when I've seen competence in Rails (barely), in C#, in Python, and in JavaScript (which is my primary expertise), but never, not once have I seen a Java web app that seemed to have been written by people who had the foggiest notion of the craft of writing code and performance/maintenance were always awful. I just spent the last two days pulling apart mashed together Tomcat, spring, struts, etc... config to try to get our app working in something newer than Java 5 and on the latest version of spring rather than like 20 different ones. If you only know Java, don't defend Java. The truth is, the language isn't horrible, just a somewhat antiquated answer to the problem of getting 100 C devs to work together without a riot, but the things the community have done with/to it in complete ignorance of why they were doing it, are absolutely mind-blowing. I'm sure you CAN write a decent web app with Java, but an inherently protectionist language that actually touts verbosity as a feature aiding clarity (if you believe that, I have some lovely Ian Fleming novels translated into legalese you should enjoy) is always going to attract complete and total suckwads. As a rule I would never advocate hiring somebody who only knew Java but I wouldn't have a problem hiring another dev if s/he knew other languages and actually preferred Java because I would like to meet that person and see how they made Java work for them in a whole !@#$ing universe of complete ass-code writing cretins. And FFS, why am I looking at 6 !@#$ing xml files, 5 interfaces, and a dozen classes just to figure out who's pulling the trigger? WTF is wrong with you people? If you have no idea why you're doing what you're doing, just stop.
Well there's the last two years of my life in a nutshell... but throw Dojo into the mix.
Fuckwads indeed.
XML is a known as a key material required to create SMD: Software of Mass Destruction
I don't think that's the advantage of weaker typing at all. I think the advantage is handling common aspects of objects without having to formally verify the type. I'm going to use an example that's been done before - say you're making a video game. You have creatures and soldiers and tanks and stuff that move around on screen. In Java, the cleanest way to implement this in a type-safe way is probably the Strategy Design Pattern. You make an interface "Move". Each way of moving - walk, run, crawl, jump, walk and jump, crawl and jump, swing from fines, fly, float, etc... becomes a separate class that implements the Move interface. All of your objects that represent movable things, solder, dog, cat, Tyrannosaurus Rex, faerie, tank, hovercraft are separate classes, and each class holds a "Move" instance internally which is invoked to control how it moves. You set that Move instance when you create each object or after you create each object, so if you want to add a movement type "Skip" later you don't have to change any existing code, and so you can create a Flying T-Rex if you want, also without changing existing code.
That works, and it's type safe. But it's also more complexity (each class holds a move instance, plus the move interface). In Clojure or Python, or even if Java if you wanted to bypass type-safety, you represent soldiers, dogs, cats, dinosaurs, etc... as untyped Maps (or Hashes, if you prefer the term). The movement types are just objects you bang into the map, and you're off to the races. You're screwed if someone puts a "swing weapon" class in the map using the key you planned for Movement, so you've lost type safety. But the logic of the program is simpler. (If my example sucks, I apologize. I am not a technical writer.)
Sort of, but it;s not really translation. Every function is internally represented as a set of such transformations, which may be partially applied to any number of arguments less than the total required to return a value.
And the translation you propose is not nearly complete.
As a clear difference you can to this (currying) in haskell with anonymous functions.
map ((*) 2) [1, 2, 3 , 4 , 5 , 6, 7]
[2, 4, 6, 8, 10, 12, 14]