Live data from Hacker News

Dart language

dartlang.org

491–500 of 504 posts

Re: Dart language

#492
post #422

Earlier quoted context omitted.

The compiler is free to optimize this how it sees fit. Taking the address of a value doesn't necessarily move it to the heap.

I imagine this optimization can only happen once escape analysis is performed. In the general case, address-of moves the data to the heap, or causes it to be stored on the heap in the first place. Correct?

Yes.

Re: Dart language

#493
post #279

I am also disappointed, but in a different way that most commenters. I don't mind java syntax, and I prefer strongly-typed languages. My concern is that Dart seems to give up a lot vs. gwt, and not add much. That is, with gwt you get - strongly typed java syntax - it abstracts away browser differences, and supports many browsers - it lets you run mostly the same code on client and server, and gives you access to lots…

"I think their original memo got many of the problems right - but I think the solution lies in a more general VM approach".

I think Dart is the preferred way to target that VM. Staying at the language level eliminates binary format headaches!

Besides, the web should not be binary.

Re: Dart language

#494
The language could satisfy the trolls at both sides of the semicolons/braces fence: your favorite editor/IDE could support your style (with two-way tools).

As for the preferred format, I suspect code with ; and {..} may remove some ambiguity, so it should execute faster. That's the decisive argument in my book.

Besides being useful by itself, I understand Dart as an intermediate language: other languages should compile into Dart. Its syntax should be extremely consistent, so code can be reasoned about.

For one day we'll need 99% accurate machine translation, like from chinese to english and back, but from Perl to Python or Javascript. In some respects that should be easier: translated functions can be tested to work identically.

Re: Dart language

#495
post #456

Earlier quoted context omitted.

Certainly feasible: Smalltalk debuggers do this. And Smalltalkers (allegedly) use a workflow just like you describe.

Yup. I often do something like this: - write a test for a method that isn't there yet - run it, get a red bar, as expected - run it in debug mode, and get a debugger - write the method implementation in the debugger - possibly write other methods that the new method calls, also in the debugger - resume the program, get a green bar Writing code in the debugger is great, because you've got all the runtime state right i…

But, is it possible to step backwards from the current state of the VM, to execute a changed code?

Re: Dart language

#496
post #301

Earlier quoted context omitted.

It sounds like there's a lot of PL innovators † here on HN, who value new technology for its intrinsic value, rather than for its benefits. I would expect PL theory to deliver great benefits at about the same rate as for other fields, e.g. that pure mathematics does for physics - some of it does; though it's common for it to be reinvented independently by people trying to solve specific problems. BTW: Notwithstanding…

It is easy to agree that there MUST be essential dependencies between modules in a system designed separated in a certain way. (Ignoring some philo arguments on identity, separation and reference point...) The issue is whether the interfacing technique adds in non-essential coupling. A technique that has at least the constraints of another technique will also have trivially have at least the non-essential coupling of…

> The issue is whether the interfacing technique adds in non-essential coupling. A technique that has at least the constraints of another technique will also have trivially have at least the non-essential coupling of the other technique.

I'm not sure exactly what you mean. Could you elaborate please?

I'll clarify my view with an analogous example: you can think of a database as having a set of types - its schema. Think of each of the applications that use that database as also having its own set of types - its classes or data structures in general. Now, an example of the "mechanism" I mean is that SQL provides a way for each app to translate data in the database's schema into its own data structures. If its data structures change, the SQL can change to adapt to that; similarly, if the DB's schema changes, it can also adapt by changing SQL (or even creating a virtual schema with another layer of SQL - a view). Of course, this only works if these are only changes of the representation of the information, and the information content itself is the same. If the information changes, in a way that the DB or an app depends on, then there's no avoiding that dependency.

A similar example are JSON/XML API's, where the JSON/XML is like the DB, and the data binding code is like SQL. The "type" of XML is often explicitly defined with an "XML Schema" document; JSON doesn't usually have that, but it is of an implicit expected form - which is still a type, just informally defined. There are also tools for converting between XML types - XSLT, and may GUI "XML mappers" that display two xml schema and let you draw lines between them.

tl;dr These enable "modules" with different types to interoperate without dependency. Each defines its own types at its own boundary, and so can be compiled independently. The middleware glue (SQL/databinder/XSLT/datamapper) facilitates interoperation by converting between types at the respective boundaries of two modules - provided those types are equivalent, i.e. contain the same information, just in a different schema/type.

Does your concept of "non-essential coupling" include the requirement of precisely identical types at the boundary? If so, by loosening that to only require the same information, this mechanism avoids that particular kind of non-essential coupling.

Re: Dart language

#497

Earlier quoted context omitted.

Please make semicolons and braces optional. Unless they are explicitly required for marking blocks and endlines they are just wasted characters to people from prettier languages :-) For those people who come from "ugly" languages like Java you could have a feature in the IDE which auto-inserted (and of course auto-removed) the braces/semicolons so that they felt at home too.

"Java" ugly ? Please name some beautiful languages.

Ruby

Re: Dart language

#498
post #85

Earlier quoted context omitted.

I've got to say, I'm looking at it and thinking "That's it?". It looks embarrassingly like C# to me. Other than that: it's got coffeescript's fast initializer syntax, but it's not as concise. It's got types but AFAICT no type inference. No destructuring either. Only thing I can see it's really got going for it is some basic types which could have been provided as a standard Javascript library (and probably will becom…

> AFAICT no type inference. Not yet. > No destructuring either. There's a proposal floating around for pattern-matching that would address that too. This is still early days for the language, so there's a lot left to be done.

I've thought about this, and I don't really think the "early days" defence is really acceptable in this case. If Dart isn't better in some appreciable way than Javascript, it has no reason to exist whatsoever. Equally, why not just adopt C# wholesale (it's even registered with the same standards body as Javascript) and give it a new library suitable for web programming?

Re: Dart language

#499
post #365

Earlier quoted context omitted.

> Google should be proposing a standard, open, byte-code compatible, Intermediate Language standard that can run Javascript and in the interim run on Javascript. > That is something I could see Mozilla and Apple getting behind. Why would you expect either Mozilla or Apple to get behind such a proposal? Apple has a powerful self-interest in making sure the Web remains a second-best app platform behind iOS and desktop…

At a technical level, virtual machines are not the panacea many folks seem to think. Certainly, VM byte code languages are often simpler than silicon processors' machine languages; perhaps they offer safety guarantees; and perhaps they provide garbage collection. These are all big wins for language implementers targeting such VMs. But what no virtual machine will ever do is make modules written in different source la…

It seems to allow for more variation in languages. The only time you really need to worry about those other languages is when you're trying to load modules written in other languages. At least that's how it works in .net. You can have pretty significant semantics from language to language and as long as you don't care about other languages actually loading your modules then it doesn't matter. If you concede that the problems of the lang->il developer are essentially the same as the lang->lang developer, then shouldn't we evaluate the il option strictly on it's merits? Such as reduced compilation at runtime and smaller payloads over the wire? As well as, optimally, less quirks than a language like JS. Not to mention existing lang->il compilers would have much less effort to retarget their output to the new platform. It just seems like a huge win to add the vm layer as the base instead of a general purpose language in every way.

Re: Dart language

#500
post #471

Earlier quoted context omitted.

How's that redundant? In C# you would just "var something = new object()", so there wouldn't be any redundancy at all.

I was replying to: "Visual Studio does it for me. I can see the point if you say it's longer to read but it's also much clearer," So he's saying that: Circle circle = new Circle() is typed by Visual Studio for you, and clearer to read. I don't think it's clearer to read.

It's kind of a misnomer too, because only the second circle is typed for you so you had to type Circle at least once... which is the same as if you were typing var. So it's not only not saving you much effort it's uglier. And with more complex types it's downright evil (to not use var).
Post reply on HN