Search for a new language that supports both interpreted and built-in compilation modes

I am currently programming in Perl, Python, C #, C, C ++, Java, and some other languages, and I am looking for a new language to use as the main language for personal projects.

My current criteria:

  • can be executed as an interpreted language (i.e., run without the need to compile it);
  • can be compiled into native code;
  • strongly typed (even if possible);
  • support for macros / templates / code conversion / wtf that you want to name;
  • has a decent number of libraries for it or is easily accessible for it;

Ideas? Suggestions?

+4
source share
3 answers

I would suggest that Haskell meets your criteria.

  • Can be run as an interpreted language? Yes, through the GHCI.
  • Can it be compiled into native code? Yes.
  • Strictly printed? Even more. Perhaps even the most strongly typed language today, with the exception of some theoretical operators such as Agda.
  • Support for macros / templates / morphing? If you are using a haskell template. However, this is an optional extension of the language, so most libraries do not use macros. I have not used the haskell template myself, so I cannot comment if it is good.
  • Is there any decent library support? The standard library is not bad. There is also Hackage, a slightly open CPAN-style Haskell library repository.

Also, it looks like you already know a lot of required / object oriented languages. IMHO, if you learn another of these languages. it will probably be a slightly different permutation of the functions that you have already seen somewhere else. Adding another software paradigm, such as functional programming, to your toolkit is likely to be a better learning experience. Although I assume that this is an advantage or not, it depends on whether you want to learn new things or quickly become productive.

+5
source

Generic Lisp is suitable: there is optional typing, efficient built-in compilation is available, powerful REPL makes it an ideal choice for scripts, and there is powerful macro macro programming.

OCaml is also suitable, with CamlP4 for metaprogramming.

+3
source

Scala? It runs scripts, although they are compiled first (transparently). I'm not sure what you mean by code conversion, etc., but that is pretty good for DSL. It meets all your requirements - it is compiled as much as Java, it is strongly typed and has a reasonable number of its own libraries, as well as all Java. I'm still a newbie, but I still like it.

-1
source

Source: https://habr.com/ru/post/1332796/


All Articles