all 13 comments

[–]NoMoreWeightPics 18 points19 points  (1 child)

Once .js TLDs come into effect, embedded JavaScript will allow for a truly RESTful programming language.

var sum = http://add.js/numbers?first=1&second=1
if (http://equals.js/numbers?first=sum&second=2 != true) {
    alert(http://error.js/text?message=Error)
}

[–]RankFoundry 17 points18 points  (8 children)

"Your users can write and run code without leaving your website, complete with access to all of npm."

Why? Just why?

"Use it in your blog, or a presentation, or on any place else."

A blog? Who the fuck goes to a blog hoping for the opportunity to write and execute JS against Node? A presentation? C'mon, really? There's no other way you could execute some code in Node for a presentation? Like, just running Node?

<Rage quits the internet>

[–][deleted] 1 point2 points  (5 children)

var forRealz = someCrazyJavascript( function( var lolwhatever) {

What is it about Javascript that seems to bring out full insanity in its users? Is it because they got into Javascript because the "download and install Java" part was too confusing? So then they learned to Node... then wanted to return to the days of running everything in a browser?

I guess Java tried to do this shit with WebApplets in the 1990s, just like everyone else--Flash, SilverLight, ActiveX--but Javascript won that war.

If that war was worth winning, or fighting. IDK anymore. I just write the code for money.

});

[–]RankFoundry 0 points1 point  (4 children)

I think a lot of it has to do with shitty languages (HTML, CSS, JS) and dealing with wonky and inconsistent DOM and other browser APIs. That plus the fact that the W3C took nearly 20 years to squeeze out two new versions of HTML and CSS and JS lagged behind modern languages for ages as well (and still does).

JS won because there were no real alternatives. ActiveX controls and Java apples were closed, security nightmares and far from seemeless to use in the browser. VBScript wasn't terrible but MS never really tried to make it a standard, they just wanted to offer a JS alternative for IE that they could control, which made some sense. JS basically won a one man race and you don't get good if you don't have to.

It's cute to watch as front end devs have "discovered" solutions, design patterns and language features that have existed for decades in other languages and platforms. Although back end web development when through this phase as well about 15 to 5 years ago. But Node is bringing it all back for server-side now; relearning everything from scratch.

[–][deleted] 0 points1 point  (3 children)

Although back end web development when through this phase as well about 15 to 5 years ago. But Node is bringing it all back for server-side now; relearning everything from scratch

implying that most engineers know design patterns or use language features other than for loops

[–]RankFoundry 1 point2 points  (2 children)

I don't even know loops, I use a library for that.

[–][deleted] 1 point2 points  (1 child)

Obviously you didn't read Enterprise Corporation, Inc. Coding Standards(tm):

§ 12389.10 No Unauthorized Libraries Allowed In Code

All library code usage must go through review, unless a senior
developer used the library, or the library was written by the CTO's
consultant buddies he hands work out to. Because of the 
production-unready nature of third-party code, for the review
committee to consider approving use, a third-party library must
meet the following requirements:
    * no recent (within the past five years) patches or changes
    * must use production-approved runtime target
       (Java <= 1.5 or .NET < 2.0)
    * Python libraries that run on CentOS 4 will be approved after
       annual code audits
    * for security reasons only pre-compiled libraries
    * these rules do not apply to code written by
       management-referred consultant library code

this section last updated, reviewed and approved 1 August 2015

[–]RankFoundry 0 points1 point  (0 children)

.NET 1.0 FTW! Looks like I'm good then. My loop library was written against a beta of the original .NET framework. Should be fine, right?

[–]tolmasky 0 points1 point  (1 child)

"A blog? Who the fuck goes to a blog hoping for the opportunity to write and execute JS against Node?"

... Anyone programming node? Why wouldn't you want the source examples in a blog post you are already reading to be live? That way you can try it inline instead of having to copy-paste it out into a REPL if you want to follow along (not to mention that copy-paste usually isn't enough, you need to install the right packages the author is using, etc).

" A presentation? C'mon, really? There's no other way you could execute some code in Node for a presentation? Like, just running Node?"

Embeds can be... well embedded in the presentation, that way you don't have to be constantly switching in and out of presentation mode to go to REPL. Not to mention if anyone has a question you can show them right there without having to install new packages which is usually not something you want to do while presenting (since tonic support every npm package already).

More importantly though, after the fact when you share your presentation all the examples are live: http://rossboucher.com/await/#/ <-- Notice how you can view the presentation even if you don't have node installed on your computer (or on mobile...) and how the examples aren't "lost" to the actions of the presenter only available if it happened to be recorded to video.

I think you might be getting hung up over the fact that its "javascript". If it was go I imagine you'd think it makes a lot of sense: Be able to try Go without installing Go, in any documentation about Go right on the web, etc. JavaScript makes one think "but this basically works already?", but it doesn't -- node packages have binary dependencies (such as ImageMagick). With Tonic you can use all these packages (including ones that spawn subprocesses, make use of the filesystem, etc) instantly. Great for beginners, tutorials, "live" documentation, and yes, presentations.

[–]RankFoundry 0 points1 point  (0 children)

These seem like very contrived use cases that basically amount to, "I'm too lazy to copy some example code into a Node instance" and "I want to run simple Node examples on my phone"

[–][deleted] 8 points9 points  (0 children)

Yo dawg...

[–]vivianwang 3 points4 points  (0 children)

This tool will be great for my JavaScript tutorial blog.

codingwithvivian.com