It’s just data

DSL for JavaScript


Jeremy Ashkenas: “work towards building a language that is to ES6 as CoffeeScript is to ES5”… close, but—do it for [ES6+HTML+CSS], and you’ll win ;)

It occurs to me that there is a shortcut available.  Let a library like React replace [ES6+HTML+CSS].  Then build a DSL for that library.

JavaScript isn’t exactly known for its ability to build DSLs.  Ruby, however, is.  And has an excellent parser library.  By transforming the AST, I can convert calendar.js.rb into calendar.js.

In the process, I start by replacing JSX with a library which was inspired by Builder, Markaby, and Tagz.  These libraries, in turn were presumably inspired by earlier works like Perl’s CGI.

But there is more.  JSX can’t directly express iteration.  Look at CommentList from the React tutorial.  Instead you build up a list, and then subsequently wrap that list.  For nested lists, it appears worthwhile to split out separate components.  There is nothing wrong with doing that, but I will suggest that the primary reason to split out a component shouldn’t be to pander to the limitations of the programming language syntax.

In Ruby you can directly express iteration.  So where a comment box in the tutorial takes four classes, an entire calendar month can be expressed in one.

And there is even more.  Functions in JavaScript are the swiss army knives of programming language features.  The can be used to express classes, blocks, lambdas, procs.  But this flexiblity comes at a price.  Ruby2JS can detect when idioms like var self=this are needed and automatically apply them.

The net is that I can write smaller, more understandable code.  And in the process focus more on the problem I’m trying to solve.

Like with CoffeeScript, "It’s just JavaScript". The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime.  You can use any existing JavaScript library seamlessly from Ruby2JS (and vice-versa). The compiled output is readable and pretty-printed, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript.

Now I don’t expect to have the success or impact that CoffeeScript has had.  But I can say that I’m having fun.  And in the process, I’m seeing the benefits with applications I write.

Thanks for sharing this post! it was very informative and helpful! keep posting and updating all users! thanks!

Posted by Dann Flin at

Having issues while using xerox printer. Just a single call to us will get your problems resolved. our Xerox Printer Support will support you to solve the query. We are available 24×7. Contact us Xerox Printer Support

Posted by Xerox Printer Support at

Dissertation Guidance Provides quality Online Dissertation Help for students.

Posted by Take My Online Class For Me at

Amazing article thanks or sharing..

Posted by Marketing Research Homework Help at

awesome post

Posted by asus customer support at

Thanks for sharing this post! very informative and helpful! keep posting! great effort! Is its parent directory writable by the server?

Posted by Is its parent directory writable by the server? at

Well thanks for posting such an outstanding idea. I like this blog & I like the topic and thinking of making it right.

Posted by matlab tutor at

A browser is an application program that provides a way to look at and interact with all the information on the World Wide Web.  if any query to the related browser then you can contact Google Chrome Support Service

Posted by Jems Ford at

awesome post so thanks for sharing the post.

Posted by safari browser support at

The Leading Assignment Help UK Firm Offers State Of The Art Services To Its Clients With A Promise Of Delivering All The Required Work Well Within The Deadline.

Posted by SPSS Homework Online at

great post

Posted by Hitachi Customer Service at



Hi buddy, your blog' s design is simple and clean and i like it. Your blog posts about Online writing Help are superb. Please keep them coming. Greets!

Posted by HBS Case Solutions at

This is really a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it. 
satta matka
satta matka
satta matka
satta matka
satta matka

Posted by satta matka at

nice post share with us.
  UC Browser customer service

Posted by Safari Browser Support at

Well thanks for posting such an outstanding idea. I like this blog & I like the topic and thinking of making it right.

Posted by medical assignment writing at

We are here to help you with any kind of issues related to your Gmail. for support service contact Gmail Customer Service .our expert will assist you and in no delay your problem will be resolved.

Posted by Gmail Support at

Thanks for sharing this post! checkout:
Best Linux Distro For Gaming

Posted by Cathy Brown at

This is great information for students. This article is very helpful i really like this blog thanks. I also have some information relevant for online dissertation help.

Posted by Matlab Project Help at

thanks for sharing very information post this is very useful post for student.

Posted by Lenovo Support Number at

Very informative article. Loved your effort in brining such a value to the content. Thanks for sharing.
xbox customer support

Posted by Xbox Customer Service at

Well thanks for posting such an outstanding idea..

Posted by Png at

Before you record something, be it in your home or a studio, the first thing you would require is a microphone and among them the condenser microphones are the best of the lot. To get suggestions about the best condenser microphones, just take a look at the site.

Posted by Best Condenser Mics at

Thanx for sharing such useful post keep it up :)

Posted by Basketball Hoop Reviews 2018 at

Things are very open and intensely clear explanation of issues. was truly information. Your website is very beneficial.

Posted by Do My Python Programming Project at

Thanks for sharing this post, it was great reading this article, would like to know more. Stay in touch, checkout Aptoide Apk

Posted by Garry Watson at

Thanks for this share, you must check out these posts they are very interesting @ GBA Games & How to give best man speech 2018

Posted by Linco Frank at

Thanks for sharing this post, keep in touch and stay connected, also get the best tv shows and movies free with the best platform with premium features at no cost
how to get Hulu free on android

Posted by Edwin Heart at

Thanks for sharing this post, very interesting and resourceful ! Also read How To Bypass Surveys

Posted by Liam at

Thanks for this share, it was very informative and helpful, keep posting and updating all users check out Best Micro Cut Shredder

Posted by Carl Bush at

Any kind of problem you face with MS Paint just reach out through our MS Paint Customer Service and get your problems solved.

Posted by MS Paint Customer Service at

Get Connected with browser Support Phone Number and get your browser issues solved instantly.

Posted by Browser Support Phone Number at

Thanks for providing such useful information. I really appreciate your professional approach.

Posted by Windows Tech Support at

Thanks for sharing this post, it was great reading this article! keep posting!

Posted by Top Paper Shredder at

This is a great inspiring article.I am pretty much pleased with your good work.You put really helpful information. Keep it up.

Posted by App Socio at

thanks for share such a wonderful information with us.

Posted by Fibroids at

Unlike in the past, cloud web hosting is not a technology for the future. But it is now used as conventional servers because of its cost effectiveness. In addition to being cost effective, it is also reliable, flexible and scalable. By the end of 2013, number of companies will use cloud hosting and 30 percent purchased will be done in cloud computing of their infrastructure. Despite the presence of issues regarding privacy by use of the cloud hosting, there are many benefits associated with cloud hosting making many of its critics become its enthusiasts very fast. Below are some of the benefits of this technology.

Posted by SiteGround UK Reviews Web Hosting at

This is very nice share with me

Posted by website designing company in Delhi at

Get help from professional coursework writers to ease your writing tasks if you are struggling hard. We are the only online coursework writing service in the UK that caters to your every need. We are the finest British online coursework help agency to help students for almost a decade now. We have obtained the place of being the best online coursework help service for our choicest and student-friendly benefits. We always keep ourselves a step further from rest of the coursework help agencies. This has only been possible due to the hard work and dedication of the professionals associated with us.

Posted by Coursework Help at

Students can score the good marks in their college and universities by hiring the best Dissertation writing help from the experts of Students Assignment Help. We offer the best assignment help services to the students.

Posted by Dissertation writing help at

This is really a innovative product. The best part is that it is very easy to create. I will try to make it.

Posted by software development companies in dubai at

this is really awesome information.

Posted by instagram picture viewer at

is this for real? Great job

Posted by Instadpviewer at

very nice information you share with us. thanks

Posted by Lyricsism at

QuickBooks is most used accounting software worldwide. Many users are using it, If you want to know more about Quickbooks or if you have any problem then you can contact us.

Posted by quickbooks support at work is best quality and truthful. We assure to provide you 100% plagiarism free Best assignment help. To avail trust and support of clients we are focus on convey best quality and error free write up. We go alone with each student who is facing problems in writing their university homework assignments. Hire our experts, and solve your problems related to any topic.

Posted by andrew symond at

thanks for sharing such a nice information i really appreciate your work in this and looking for more such good posts in the future thank you

Posted by pawel34ss at

Great site and a great topic as well I really get amazed to read this. It’s really good. I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. Assignment help | Assignment Expert | Marketing Assignment help | Law Assignment help | Make My Law Assignment

Posted by assignment at


Posted by Lyrics with music at

Much obliged for the online journal stacked with such a variety of data. Ceasing by your site assisted me with getting what I was searching for. Literature Review Assignment help | Assignment help

Posted by guzarish at

Thanks for this article. It contains the information i was searching for and you have also explained it well. We are also a service provider that deal in the assignment writing help sector. So, the students struggling to write their college assignments can opt for our online HRM Assignment help and can get a quality assignment written from us.

Posted by dhoka at

Blog gave us useful information to work. You have done an amazing job.
TP-Link Router Support

Posted by Tp-link Router Support at

Your blog is great. i read a lot of interesting things from it. thank you very much for sharing. hope you will update more news in the future.

Posted by windows 7 product key at

Thanks you for very nice its sharing

Posted by website designing company in India at

Add your comment