Web Technology(2)AltJavaScript

Machine Learning Artificial Intelligence Natural Language Processing Semantic Web Algorithm Search Technology DataBase Technology Ontology Technology Digital Transformation Javascript UI and DataVisualization Workflow & Services CSS Web Technologies Navigation of this blog
Web Technology(2)AltJavaScript

Following the previous section on web application structure, I will give an overview of development tools and AltaJavascript.

In the aforementioned modern web applications, the code used during development differs from the code used in the actual product. Developers write code in the latest version of JavaScript that may not be supported by the browser, make heavy use of third-party packages and their dependent objects in the node_modules folder, and use static analysis tools and compression tools (Minifier). Use static analysis tools, compression tools (Minifier), etc. to develop. Build tools are the ones that convert and effectively deploy all of this into a form that most web browsers can understand.

Some build tools are called module bundlers, which can combine all the code into a few files (bundles), such as Webpack, Browserify, and Rollup.js.

Another tool in the build tool arsenal is what is also called a transpiler. In order to make code written in the latest Javascript work on legacy browsers and devices that only partially or not at all support it, the code needs to be converted to a previous version of code that can work. Babel is a compiler that converts code into compatible code that can be used in most browsers.

The module bundler and the transpiler are only part of the build process required for a project. Other processes include code compression (to reduce file size), use of analysis tools, and in some cases, tasks that do not involve JavaScript, such as image optimization and use of CSS/HTML preprocessors. There are tasks that do not involve JavaScript. Grunt.js and Gulp.js are tools that automate task management and allow any operation to be performed with a simple command.

Next, we will discuss AltJS (an alternative JavaScript language), which is a programming language that generates JavaScript by compiling, and was developed to alleviate the complexity of JavaScript’s syntax and to cover problems such as dynamic typing. AltJS was developed to alleviate the complexity of JavaScript syntax and to cover issues such as dynamic typing.

The advantage of using AltJS is the readability and maintainability of the code; the syntax is more organized than JavaScirpt, which allows for early detection of bugs and is easier to maintain than plain JavaScirpt.

There are more than 10 types of AltJs proposed by various sources, but according to the JavaScript-related survey data released by the State of JavaScript in 2019, TypeScript, Reason, Elm, PureScript, and Clojurescript are the most popular in that order. TypeScript, Reason, Elm, PureScript, and Clojurescript are the most popular. Other languages include Dart, CoffeScript, Scala.js, Haxe, and Nim.

TypeScript is a superset of JavaScript, and unlike the other languages, it inherits the philosophy of JavaScript and adds only features that improve the soundness of the code. Type annotations and other type-related features have been added, and static code analysis and other useful tools for refactoring can be used, making it “JavaScript that can be written more comfortably” is one of its features. The existence of types improves the passing of data between separate components, and since it supports type inference, it is possible to add types later to enhance the code without having to write all the types every time. Also, if you are using React, you can use JSX by adding React types.

Reason is a language developed and maintained by Facebook, with new syntax added for the OCaml (OCamel) compiler, which makes it translatable to both JavaScript or native code. Since it is a dialect of the ML language, a functional language, it has a powerful and flexible type system, with type inference, algebraic data types, and pattern matching. With its support for immutable data types and polymorphism (also called generics in some languages), OCaml also allows for object-oriented programming. With the bucklescript binding, existing JavaScript libraries can be used, and JSX is also supported when using React.

Elm is a pure functional language that can be compiled into JavaScript, HTML, and CSS, making it a language that can be used in place of JavaScript frameworks such as React, since a complete site can be built using Elm alone. Elm apps are very fast, and can be used in conjunction with existing JavaScript by using ports to interact with JavaScript and other libraries.

PureScript is a purely functional and strongly typed programming language that is ideologically designed to be highly compatible with existing JavaScript libraries, similar to Haskell. Like other languages, PureScript has its own build tool, Pulp, which is similar to Gulp. It uses features from Haskell, especially for types, which allows for sophisticated abstraction.

ClojureScript is a compiler that converts from the Clojure programming language to JavaScript, and has features that support Clojure’s dynamic typing and general-purpose functional language for unchangeable (immutable) data structures. ClojureScript is a Lisp programming language, which means that code is treated as data and macros can be used to enable metaprogramming. Unlike other Lisp-based languages, Clojure supports immutable data structures, making it easier to manage side effects. ClojureScript uses Google Closure for code optimization, making it compatible with existing JavaScript libraries.

With the exception of TypeScript, which makes JavaScript easier to write, it is interesting to note that the other popular languages all use functional language features. In addition, each language is characterized by its handling of “types,” which is important when talking about programming languages, and I’d like to sort out these issues at a later date.

In these languages, the negative legacy of JavaScript (difficulty in use) has been resolved, so if you can master it, it can be considered a great weapon, but in order to master it, knowledge of JavaScript is essential. Anyway, after learning the language (javascript) and increasing your knowledge, you will be able to understand how the framework works and make a satisfactory choice.

In the next article, I would like to talk about programming languages.

コメント

タイトルとURLをコピーしました