What is the difference between a Library and a Language extension? Specifically in Scala.
An extension language is a programming language interpreter offered by an application program, so that users can write macros or even full-fledged programs to extend the original application.
The purpose of the Language Library is to translate any string value (text) to another language. There are very specific use cases for the Language Library. you may need to change the captions of some build-in labels to something suitable to your organization.
C++ is much efficient compare to most of programming languages. Many powerful libraries such as TensorFlow and Torch are implemented in the C++ programming language so machine learning and C++ is truly a great combination.
In programming, a library is a collection of precompiled routines that a program can use. The routines, sometimes called modules, are stored in object format. Libraries are particularly useful for storing frequently used routines because you do not need to explicitly link them to every program that uses them.
This is the Scala language specification. If you can write it with the language described by this specification, then it is a library. If you make changes to the language described by this document that cannot be written in the language itself, then it is a language extension.
This is valid both for Scala and for Java, a library could be defined as:
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications.
It means that (I know, I simplify a lot) a library is a collection of routines you'll use in your code to implement an algorithm. They save you to write the same code again and again (for example you do not need to reinvent the wheel every time you have to print a string to console).
A language extension is not code that you'll call (or use) directly from your code but something that will change how you write your programs. It may change (and usually it does) the syntax of the language itself and often it's a plug-in for the compiler. Many of the features added to the Java language are extension (generics, for example).
For example Session-Scala is an extensions made of both:
For an example take a look to this page.
That said, often with Scala a language extension isn't really needed (even if it's so easy to write, more than for .NET languages, for example) because of its syntax. First thing that comes to my mind are infix operators but in general all its syntax for methods invocation makes everything simple to use it as DSL without a DSL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With