Clojure – Devstyler.io https://devstyler.io News for developers from tech to lifestyle Thu, 05 Aug 2021 13:19:51 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 The Programming Language That Both Hackers and Coders Like https://devstyler.io/blog/2021/08/05/the-programming-language-that-both-hackers-and-coders-like/ Thu, 05 Aug 2021 13:19:51 +0000 https://devstyler.io/?p=64013 ...]]> Rust is the most loved programming language amongst developers today, while COBOL (Common Business Oriented Language) is the most dreaded, said a new survey by Q&A website Stack Overflow.

According to the survey, Clojure, TypeScript, Elixir and Julia took the next four spots, respectively, in the top five most loved programming languages amongst developers. Despite how popular Apple’s devices are, the company’s Swift programming languages was the eighth most popular language amongst developers.

Rust, though, is not only a favourite amongst developers. A July 2021 whitepaper from BlackBerry noted that cybercriminals and malware makers are also adopting the language to build trojans that can be used for infiltrating devices. “Malware authors are known for their ability to adapt and modify their skills and behaviors to take advantage of newer technologies,” said Eric Milam, vice president of Threat Research at BlackBerry. He added:

“This has multiple benefits from the development cycle and inherent lack of coverage from protective products. This paper looks into less prolific programming languages and their use in the malware space. It is critical that industry and customers understand and keep tabs on these trends, as they are only going to increase.”

Further, despite efforts by companies like Google and Apple to put an end to JavaScripts, the language remains the most common amongst scripting languages. These are often used to track users’ activity online and to make web pages interactive. HTML/CSS and Python were also preferred by developers.

Amongst frameworks and libraries – code written by others that can be used to solve common problems – Google’s TensorFlow was amongst the top five while Microsoft’s .NET was the most loved framework. The company’s Windows was also a favourite operating system amongst developers, while Linux-based operating systems came in second. Apple’s MacOS was the third most preferred operating system for developers.

]]>
11 Hot Language Projects Riding WebAssembly https://devstyler.io/blog/2021/06/28/11-hot-language-projects-riding-webassembly/ Mon, 28 Jun 2021 10:39:15 +0000 https://devstyler.io/?p=56592 ...]]> From blazing-fast web apps to Python data science in the browser, these programming language and compiler projects offer different twists on the promise of WebAssembly.

WebAssembly is a low-level, assembly-like language with a compact binary format that runs with near-native performance in web browsers. Hailed as a way to both improve web application performance and allow languages other than JavaScript to be used in the development of browser apps. WebAssembly has led to the development of a range of new technologies, including whole new programming languages, that harness its power. So, here are 10 language projects that have made big bets on WebAssembly.

Blazor WebAssembly

Blazor WebAssembly is a framework for building interactive, client-side, single-page web apps using .NET and hosting those apps in modern browsers (including mobile browsers) on a WebAssembly-based .NET runtime. No plug-ins or recompiling of code into other languages is required. The runtime enables the .NET code to access browser functionality via WebAssembly’s JavaScript APIs.

When a Blazor WebAssembly app is run in the browser, C# code files and Razor files are compiled into .NET assemblies, which are downloaded to the browser along with the .NET runtime. The apps can be deployed standalone or with server-side support.

Cheerp

Leaning Technologies’ Cheerp is positioned as an enterprise-grade C/C++ compiler for the web, compiling C and C++, up to C++ 17, into WebAssembly, JavaScript, or a combination of the two. Cheerp is integrated into LLVM/Clang infrastructure, with custom optimizations intended to improve performance and minimize the size of the compiled output. Primarily used to port existing C/C++ libraries and applications to HTML5, Cheerp also can be used to write web applications and WebAssembly components. Cheerp is offered under open source and commercial licenses.

Binaryen

Binaryen is a compiler toolchain infrastructure library for WebAssembly. Written in C++, Binaryen is intended to make compiling to WebAssembly easy, effective, and fast. It has a C API in a single header, and it can be used from JavaScript. Input is accepted in WebAssembly-like form but a general control graph also is accepted for compilers that prefer it.

The internal IR (intermediate representation) of Binaryen uses compact data structures and draws on all CPU cores for parallel collagen and optimization. The IR also compiles down to WebAssembly easily because it is essentially a subset of WebAssembly. WebAssembly-specific optimizations improve both code size and speed, making Binaryen useful as a compiler back end by itself.

CheerpJ

Billed as “the Java compiler for the web,” this LLVM-based compiler converts any Java client application into WebAssembly, JavaScript, and HTML, enabling Java client applications to run in modern browsers. CheerpJ leverages three components: an AOT compiler, a runtime in WebAssembly and JavaScript, and JavaScript DOM interoperability APIs, to access the DOM from Java. With CheerpJ, JAR archives can be compiled using the AOT compiler. CheerpJ does not require any server-side support.

Emscripten

This open-source compiler toolchain compiles C and C++, or any other language using LLVM compiler technology, into WebAssembly for deployment on the web, Node.js, or a Wasm runtime such as Wasmer. Emscripten has been used to convert a list of real-world codebases into WebAssembly, including commercial codebases such as the Unreal Engine 4 game engine and Unity 3D platform. Emscripten supports the C and C++ standard libraries, C++ exceptions, and OpenGL/WebGL graphics commands. The Emscripten SDK used to install the Emscripten toolchain can be used on Linux, macOS, and Windows.

Forest

Forest is a functional programming language that compiles to WebAssembly. The goal behind Forest is to provide a language that makes it easier to create web apps that are complex, interactive, and functional, but without the traditional overhead of that approach, developer Nick Johnstone said.

Currently described as “pre-alpha, experimental, conceptual research software,” Forest features static typing, pattern matching, immutable data structures, multiple syntaxes, and automatic code formatting. The first syntax in development is inspired by Elm and Haskell.

Design principles of the Forest language include ease of collaboration, painless-as-possible testing, and agreement on structure and semantics while agreeing to disagree on syntax. Johnstone strives to make Forest fast enough for building complex games so that normal web apps will be “blazing fast.”

JWebAssembly

JWebAssembly, from I-Net Software, is a Java bytecode to WebAssembly compiler that takes Java class files as input and generates WebAssembly binary format (.wasm file) or text format (.wat file) as output. The target is to run natively in the browser with WebAssembly. In theory, JWebAssembly can compile any language that compiles to Java bytecode such as Clojure, Groovy, JRuby, Kotlin, and Scala, pending testing.

JWebAssembly is not yet production-ready. Although everything necessary for the JWebAssembly 1.0 release has been implemented, testing still remains to be done. The version 1.0 roadmap calls for capabilities such as a Java bytecode parser, a test framework, and a Gradle plug-in. I-Net Software expects to ship JWebAssembly 1.0 this year.

Uno Platform

An alternative to the Xamarin mobile app platform, Uno Platform is a UI platform for .NET teams to build single-codebase applications for WebAssembly, the web, Windows, macOS, Linux, iOS, and Android, using C# and XAML. Uno leverages the Mono-WASM runtime in .NET 5 to run C# code in all of the major web browsers and serves as a bridge for WinUI and UWP (Universal Windows Platform) apps to run natively on WebAssembly. For building web apps with Uno, developers can use Visual Studio or Visual Studio Code.

Pyodide

The Pyodide project, which recently moved from Mozilla to become an independent project, compiles Python and the Python scientific stack to WebAssembly, bringing the Python 3.8 runtime, NumPy, SciPy, Matplotlib, Scikit-learn, and dozens of other packages to the browser. Pyodide provides transparent conversion of objects between JavaScript and Python and gives Python access to web APIs. Pyodide began in 2018 as part of the Iodide project for doing data science in a browser. Pyodide can be tried from a REPL in the browser.

TeaVM

An ahead-of-time compiler for Java bytecode, TeaVM emits WebAssembly and JavaScript to run in the browser. However, note that WebAssembly support is currently experimental. Like close cousin GWT (Google Web Toolkit), TeaVM allows developers to write applications in Java and deploy them as JavaScript. Unlike GWT, TeaVM works with compiled class files, not source code. In addition, TeaVM relies on existing compilers such as javac, kotlinc, and scalac, so can compile Kotlin and Scala code as well as Java. TeaVM is primarily a web development tool; it’s not designed for taking large codebases in Java or Kotlin and producing JavaScript. A TeaVM subproject, Flavour, serves as a framework for writing single-page web applications.

Grain

The Grain language brings features from academic and functional languages to the 21st century, the project website states. Compiling to WebAssembly via the Binaryen toolchain and compiler infrastructure, Grain can run in the browser, on the server, and potentially anywhere. There are no runtime type errors and no need for type annotations. The Grain toolchain features a CLI, compiler, runtime, and standard library, shipping as a single binary. Developers will need Node.js and Yarn to build Grain from source, and binaries are available for Linux, macOS, and Windows.

]]>
The Coding Language Used by The Most Elite Developers in Finance https://devstyler.io/blog/2021/06/21/the-coding-language-used-by-the-most-elite-developers-in-finance/ Mon, 21 Jun 2021 11:12:05 +0000 https://devstyler.io/?p=55521 ...]]> If you’re learning a coding language with a view to becoming employable in a technology role in financial services, you should choose something like Python, which is well-used across the industry, or go for something a little more obscure?

In relation to the obscurity route, we’ve already looked at the value of languages like K and Q for finance jobs, but there’s also merit to learning functional programming languages like Clojure, F#, Scala, Elixir, and…OCaml.

OCaml is the language used by Jane Street, the quantitative market-making firm that last year paid its lucky graduate trainees a $200k annual base salary, plus a $100k sign-on bonus, plus a $100k-$150k guaranteed performance bonus.

Jane Street uses OCaml as its primary development language. In a YouTube video posted six years ago that had over 62,000 hits and counting, Yaron Minsky, Jane Street’s head of technology and the man who convinced the firm to use OCaml in the first place, said the language is “in a kind of sweet spot in the design space.”

“It is concise, like traditional dynamic languages are and efficient on the scale that traditional compiled languages are. It has a type system that catches lots of errors for you.. and is relatively easy to work with.”

At one point, Minksy said Jane Street thought of using C# but OCaml was much more concise and easy to read, making it less prone to errors. Separately, Minksy observed that Python is, “crushingly horribly insanely slow.” Minksy said Jane Street uses the language for everything from little scripts to automate small tasks, to big trading systems trading billions of dollars a day. It’s a “single tool that works for a large variety of applications.”

The only problem with OCaml is that not many people know how to code in it, and therefore not many people use it. At Github just 0.121% of pull requests are in OCaml, putting it slightly ahead of R (0.093%) and Julia (0.071%), but way behind Javascript (18.8%) and Python (16.6%). Moreover, OCaml is becoming less rather than more popular – in 2016, 0.226% of Github’s pull requests were in the language; OCaml has more than halved in popularity in the space of five years.

Maybe this doesn’t matter. Minksy explains that Jane Street‘s rationale for using OCaml is partly based on the “Python Paradox” posited in the early days of Python by YCombinator founder, Paul Graham. This says that:

“If a company chooses to write its software in a comparatively esoteric language, they’ll be able to hire better programmers because they’ll attract only those who cared enough to learn it.”

On this basis, your value as a developer is partly defined by your commitment to learning obscure languages. And although Jane Street doesn’t actually mandate knowledge of OCaml for its interviews, if you can code in its pet language, it will show a lot more interest in the role than if you can’t. However, OCaml isn’t easy to learn. Blind commented on a poster last year:

“Anyone apt enough to learn OCaml can likely pick up other languages. OCaml will teach you some deep and transferable skills,” said another poster on Reddit, adding that the OCaml route is, “profound and mind-changing.”

It’s not just Jane Street that uses OCaml, and it’s not just Jane Street’s developers who can code in the language. Technologists and quants who can code in OCaml are to be found everywhere from Citi to Morgan Stanley, JPMorgan and Goldman Sachs. Bloomberg uses OCaml for an advanced financial derivatives risk management application. Outside of finance, it’s used by Facebook and by Dropbox, among others.

The potential danger of becoming highly proficient in OCaml is that you’ll get a job at Jane Street, become immersed in the language, and – in the style of Slang at Goldman Sachs – slowly become less employable anywhere else.

]]>