Tuesday, August 08, 2006

Compiling to JavaScript

Treating JavaScript as a back-end for a compiler is becoming more and more popular. Here are some examples of compilers that already target JavaScript:
This has come up in some of the ECMA-TG1 discussions, and I think some of Edition 4 will help compiler writers, in particular proper tail calls. On the other hand, I'm not sure whether "compiling X to JavaScript" is always a priori a net gain.

Some of these compilers are more toys than anything else: people always get a kick out of translating idioms between languages. That's fun, if a little boring after a while. But a lot of these tools are aiming at building abstractions for web programming, which is much more ambitious.

If you can properly build an abstraction on top of the many incompatibilities and low-level details of web platforms, then the abstraction is probably appropriate. But without a model for the "ideal" behavior of web browsers as approximated by each of the real ones, then the abstraction is likely to be either crippled or flawed. In this case, adding this layer of indirection may actually be maddeningly difficult to work with when it fails. If it's too simplistic, you'll eventually have to give up and drop down to the lower layer. This might be fine, if there are "trap doors" -- such as a foreign interface to JavaScript -- that allow the programmer to dip into the lower level when necessary. But if the abstractions have flaws in them, debugging will have become worse than before, because it involves debugging through the extra level of abstraction, wading through generated code, understanding the compatibility layer, etc.

I still think these abstractions are an important goal, but the hard part isn't the compilers. It's understanding the models, i.e., the implicit specifications for web browsers. Apparently Ian Hickson has done a lot of great work compiling empirical data about the behavior of existing web browsers to infer the implicit specs for web standards. This kind of work is messy and tedious, but important.

24 comments:

Anonymous said...

Pugs, the Perl 6 compiler, is also targetting JavaScript.

Unknown said...

You could add sml to your list

Unknown said...

Something went wrong, here is the link:

http://www.itu.dk/people/mael/smltojs/

Artem said...

Don't forget Haskell Javascript backend: http://haskell.org/haskellwiki/Yhc

Ruby on Rails Consultants said...

This isn't working
http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html
404 Not Found

Pavel Co Ebele said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai

Geek Squad said...

Thank you for this blog. I was about to sign up to first rate when this showed up in the results. I hope I can find something that can really help me out. I do not drive so an online work will be great.It really makes me happy and I am satisfied with the arrangement of your post. You are really a talented person I have ever seen.Webroot geek squad visit for more information

Gangathara said...

Car rental Software
A car rental or car hire agency is a company that rents automobiles for short periods of time for a fee. It is often organized with numerous local branches, and primarily located near airports or busy city areas and often complemented by a website allowing online reservations.
Retailing Software
Retail software is computer software typically installed on PC-type computers or more recently delivered via the Internet. Traditionally this software was delivered via physical data storage media sold to end consumer but very few companies still provide their software using physical media.
Business-consultancy-service
A business consultant is a professional who provides professional or expert advice in a particular area such as security, management, accountancy, law, human resources, marketing, finance, engineering, science, digital transformation or any of many other specialized fields

yuva said...


ecommerce app development companies

Ecommerce development companies keep various points into consideration to deliver the best ecommerce web or app to suit your business requirements. They are the experts backed by years of experience & expertise in this field to deliver such complex project flawlessly

josh said...

Textile industry Software
Generally, software applications that have 2D or 3D technology integrated into them are used in the dyeing, printing, and finishing industry. Computer Aided Application (CAD), Computer Aided Manufacturing (CAM), and Computer Integrated Manufacturing (CIM) are the three main software applications used.

ranjani said...

Construction Management Software

To own construction business is not an easy deal as it involves high risks and good management skills to ensure the project is completed according to the draft plan. A mindset, proper tools, and some experience are required to tackle the business tasks. With the overabundance of engaging duties, as a construction manager, it becomes tiring to deal with a giant heap of responsibilities. But the right technological tool can make it all simple for you.


candy said...

Digital Workplace Software

The digital workplace is a central working environment that employees can access from anywhere and at any time – whether they’re on the train, in their home office or at the beach. All data is stored in one location and can be accessed quickly and easily. Your employees are freer to determine when and how they work and therefore more efficient. Discover the digital workplace for your company.

candy said...

POS Billing Software

A POS billing system, or commonly known as a Retail POS Software is a billing software for retail stores to manage the store. It generates invoices, accepts payments, manages stock, inventory, and the customer database.

rohit said...

GST Billing Software

The best GST billing software is a business tool that any small, medium or large-scale businesses must implement to effectively manage operations and facilities. It not only increases the potential credibility of an organization but also eradicates the errors or complications that are generally accompanied by the traditional (manual) billing methods.
In this article, we will walk you through the vital features that your billing software must-have. Please make sure you only implement software that saves time and not waste it. Are you looking for a cost-efficient GST billing software that can manage all your financial data? Subscribe to Imprezz.in. Read this article to know what unique feature Imprezz.in offers.

millar said...

Employee self service software

Employee self-service is a widely used human resources technology that enables employees to perform many job-related functions, such as applying for reimbursement, updating personal information and accessing company benefits information -- which was once largely paper-based, or otherwise would have been .

josh said...

Law practice management software

A modern law firm needs a reliable system for managing client matters. Most use Law Practice Management Software (LPMS) for this. The options run from streamlined law-firm productivity software to all-in-one law firm marketing and business management software to software that can be integrated with other software and code for a client service technology stack customized to your firm’s specific needs.
Often, your choice of LPMS systems will hinge on the type of law you practice, the software your firm uses, and your comfort with adjusting the software to your needs. For example, most of the legal management systems included in these reviews integrate with Office 365, and Google’s G Suite products. However, you’ll want to confirm that (among other integrations) prior to purchase

josh said...

Parks and recreation software

The recreation software streamlines the management of your operations, which reduces back-office tasks, increases efficiency, and boosts revenue all in one place. The software programs are made up of comprehensive modules equipped with a wide variety of features to cover any and every recreational need.

candy said...

Printing packaging industry software

Maximising economies-to-scale, highest machine allocation and supplies control are some of the challenges the print and packaging sector face. Firms also need to be innovative over minimising waste due to the growing concerns from consumers over environmental issues. With all the different challenges the printing and packaging industry face, managers need to have a complete view of the business.

ranjani said...

Construction crm software

Most customer relationship management platforms are multi-purpose. They can be used for a range of business applications, including construction work. But some are built specifically for the industry.
Over the past decade, the CRM market has grown roughly 8 times larger. Web-based CRM systems have become cheaper, better, and easier to implement. A small business can now use one and enjoy real results.

mahi said...

Customer experience management software

Experience management software allows businesses to measure customer impressions through feedback, seeing how that feedback relates to the business metrics, and analyzing them as one.

rohit said...

Patient case management software

Unlike electronic medical records (EMRs) and electronic health records (EHRs), patient management systems help clinicians provide value-based care by improving patient engagement and nurturing patient-provider relationships.

ranjani said...

Hardware and paint store software

Successfully manage your sales, your special orders, your customers, your inventory, and your accounting - Aralco POS Software is designed for Paint, Hardware and Auto Parts Stores.
These stores of all sizes can benefit from the Aralco point of sale system because they automate virtually every part of the business for you.
Aralco POS software boosts efficiency and productivity in your store environment and allows you to ring up items quickly and easily, manage time and inventory and develop customer loyalty. Aralco POS software allows you to keep the real-time inventory of all kinds of products from paint cans to the copper wire by the meter.

rohit said...

Builder CRM software

Our CRM is a tool that allows you to capture, organize, collaborate, follow-up, and access critical data from anywhere.
In other words, it helps keep all your company information organized and secure. Which means your entire company is on the same page and working together in unison.

John Fei said...

Java advancement innovation is a programming language that permits creating applications beginning from your cell phone to logical working frameworks. As the computerized world is acquiring force, numerous organizations grade to an offshore advancement model to enlist their Java engineers abroad. Since first experience with the IT world in 1995, offshore Java improvement administrations have been demonstrated as the most dependable, quick, and secure innovation for applications and site creation. Official measurements show that starting at 2019, the world's number of programmers hit 24 million and anticipated to grow up to 29 million constantly 2029. Talking about explicitly Java engineers, the number has been quickly expanding since 2003; as indicated by Evans Data Corporation, in 2003 the world saw around 1.5 million Java offshore designers, in 2007 – 6 million, and nowadays the number goes up to 7 million subject matter experts. The vital motivations to employ Java engineer offshore incorporate decreased work costs, advantageous participation, and quality administrations. From top Fortune 100 organizations to SMEs, associations see boundless freedoms by appointing their ventures to a Java offshore group. Walk 2020 constrained the greater part of the organizations to move representatives on the far off model of working because of the COVID-2019 flare-up. In light of this, organizations that haven't applied an offshoring model of recruiting engineers will consider reevaluating as an approach to keep their tasks from falldowns later on.