[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]

/prog/ - Programming

Programming board

Catalog

8chan Bitcoin address: 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C
The next generation of Infinity is here (discussion) (contribute)
A message from @CodeMonkeyZ, 2ch lead developer: "How Hiroyuki Nishimura will sell 4chan data"
Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 1 per post.


2de972 No.49

https://www.dartlang.org/

Anybody else here use it? What do you think?

I've been using it for over a year now, and it's slowly dethroning python as my fav language. Sane OO, nice+easy lambdas, solid core libs, nowhere near the clusterfuck that is JS, and OPTIONAL_TYPING_MASTERRACE

a560ed No.50

Do you have to compile it to js to run it in the browser?

2de972 No.51

>>50

Only for deployment right now. It comes with it's own version of chromium that runs the Dart VM natively though, so developing/testing with it is pretty seamless. And chrome is about to get native dart support soon-ish anyway (I believe they're just waiting on some refactoring or something inside chrome's rendering engine to finish up).

c5ef56 No.55

I messed with it a long time ago and meant to get into it but I had no motive. Maybe I'll look at it again!

ff7f48 No.91

>>49
http://markmail.org/message/uro3jtoitlmq6x7t

theoretically this shouldn't be a big deal but makes me question motives behind dart. a bit. not paranoidically.

2de972 No.100

>>91

> Javascript as it exists today will likely not be a viable solution long-term. Something must change.


> There are two ways to approach the problem: either we can try to evolve Javascript, or we can push for a new language that addresses core problems in Javascript that can’t be repaired easily or quickly.


> The “evolve Javascript” option is relatively low risk, but even in the best case it will take years and will be limited by fundamental problems in the language (like the existence of a single Number primitive). Javascript has historical baggage that cannot be solved without a clean break. Thus, although it’s low risk, it’s also relatively low reward.


> The “clean break” option is extremely high risk–it will be a huge challenge to convince other browser vendors to rally around a new language–but is the only way to escape the historic problems with Javascript. Thus, its high risk is matched by the potential for a very high reward–a classic leapfrog strategy.


> The goal of the Dash effort is ultimately to replace JavaScript as the lingua franca of web development on the open web platform. We will proactively evangelize Dash with web developers and all other browser vendors and actively push for its standardization and adoption across the board. This will be a difficult effort requiring finesse and determination, but we are committed to doing everything possible to help it succeed.


I'm not sure if there are many motives to really question there. All the points seem completely reasonable and accurate as far as I can tell. The only alternative would be something 'designed-by-committee', and we all saw how well that worked out for XHTML and all that.

Doesn't take a JS wiz to notice the ecosystem's a mess. There are literally task runners for task runners and package managers for package managers now, and you need like half a dozen utility libraries and frameworks to even start most semi-medium-sized projects. A clean break is the only reasonable long-term solution IMO. Anything less would be like us refusing to move away from FORTRAN.

78b12a No.110

>>100
Pretty much this. I don't think it's Google trying to dominate the world again, JavaScript does need a replacement because it's fucking bad. Maybe some minor library specifications to keep JavaScript functions consistent between browsers (like, you know, some library to get the user's last input instead of having to use a specific function for Firefox and the rest of the browsers) yet keep potential vulnerabilities checked thanks to a small code base, or truly integrate stuff like inheritance in the language instead of having to rely on hacks.

JavaScript needs to evolve, and that evolution probably comes by replacing it with another language or even bytecode. What would you think of LLVM interpreters in browsers? You could code webs in any language.

8ffe7e No.116

Sorry, newer programmer here. What's a lambda?

2de972 No.117

>>116

A 'lambda' is just an anonymous function (a function/method that doesn't need to be formally defined to be used).

So instead of doing something like


// Define a function
void onClick(event) {
print("hello");
}

// Pass it to something that will use it eventually
someButton.onClick(onClick);


You'd just do:


someButton.onClick((event) {
print("hello");
});

// or the shorter version:

someButton.onClick((event) => print("hello"))

fa5886 No.121

>>117
I have never used lambdas for anything else other than what you wrote. Are they something more than syntactic sugar?

2de972 No.137

>>121

Read up on List/Haskell and functional programming. Lamdas are a crucial feature for certain functional styles of doing things.

If you're familiar with underscore.js, or Ruby's blocks, you'll know why they're useful.

Example:


// JS with Underscore

var squares = _.map([1,2,3,4,5], function(i) {
return i*i;
});

// instead of

var squares = [];
for (var i=0; i < 5; i++) {
squares.push(i*i);
}

// which can be useful for a lot of things.

———————–

#Here's the same thing in Ruby:
squares = []
(5).times do |i|
squares << i*i
end

# or a more useful example
File.open('something.txt') do |file|
#do something with file…
end
# Ruby 'blocks' are lambdas

————————-

// and back in dart

var squares = [1,2,3,4,5].map((i) => i*i);


So no, it's not just 'syntactic sugar', they're useful constructs.

2de972 No.140

>>137
Fuck, I meant LISP / Haskell, not 'List'. But same idea really…

http://lisperati.com/casting.html

d20b92 No.189

>>137
In ES6 you can actually do what dart does there with the fat-arrow function notation. For ES5 implementations there exists an ES6 transpiler (i do believe it's called es6-transpiler).

JavaScript is destined to obsolete everything else, you know it makes sense.

2de972 No.206

>>189

I think the big win with the lambda notation is less about the fat arrow shorthand, and more about not needing to clutter up your code by explicitly writing 'function' everywhere for regular anonymous blocks.

I sure as hell never use one-liners enough to care about the '=>' syntax anyway…

2de972 No.279

I like dart, I just wish AngularDart had better documentation to go along with it. They made a pretty big breaking change with the controllers in it recently, and it has yet to really be documented how to go about dealing with that.

Hope it matures a bit more in the next year or so, cause I do enjoy the language+workflow.

327b34 No.1315

>>110
> What would you think of LLVM interpreters in browsers?

Websites can't use bytecode until browsers have interpreters and browsers have no reason to have interpreters because websites don't use bytecode.

So would any major browser be willing to break the deadlock?

7f6fff No.1594

>>110
Why did something like Lua lose in the first place?

Something embeddable and fast instead of this crazy spec that no one follows properly.

7e9689 No.1623

>>1594
>Why did something like Lua lose in the first place?
See: https://en.wikipedia.org/wiki/JavaScript#Beginnings_at_Netscape

tl;dr - JS was in the right place at the right time combined with "don't fix what isn't broken" mentality.

I imagine the vaguely C-like syntax didn't hurt its adoption either.

000000 No.1837

I wish dart would be used more. How well is using javascript libs from Dart supported?

7ca4b3 No.1839

>Google decided not to integrate the Dart VM into Chrome

>>>/tech/173064

773370 No.1847

In theory it's a saner language that allows for better optimization and isn't a superset of JS, unlike TypeScript.

The VM is good to embed elsewhere.

I think it's good to see something not spoiled by the web.



[Return][Go to top][Catalog][Post a Reply]
Delete Post [ ]
[]
[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]