Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming languages with python-like syntax but native code generation

Can anyone point to programming language which has python-like syntax, but from the very beginning was designed to generate native code? I'm aware of Boo only, but it uses .net, not native code generation. Well, if nothing else than python-like languages which generate .net/java bytecode are fine too.

like image 243
maykeye Avatar asked Jul 21 '09 04:07

maykeye


People also ask

What programming languages have a similar syntax to Python?

Python is often compared to other interpreted languages such as Java, JavaScript, Perl, Tcl, or Smalltalk. Comparisons to C++, Common Lisp and Scheme can also be enlightening.

Which programming languages have similar syntax?

JavaScript and C++ are two languages that are very similar. They can be used to make the same things and code looks very similar.

Is there a compiled language like Python?

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula.


2 Answers

Cython might do -- the C code it generates is for Python extensions, but the whole thing can be packaged up and you'll be running native code throughout (after the 'import';-).

like image 62
Alex Martelli Avatar answered Sep 21 '22 11:09

Alex Martelli


I must admit that I don't quite understand your question, for two reasons:

  1. You are asking for a language with native code generation, but native code generation has nothing to do with the language, it is a trait of the implementation. Every language can have an implementation with native code generation. Several Python implementations have native code generation. There are C compilers that compile to JVM bytecode, CIL bytecode or even ECMAScript sourcecode. There are even C interpreters. There are also compilers that compile Java sourcecode or JVM bytecode to native code.

  2. Why do you care about the syntax? It is probably the least important factor about choosing a programming language.

Anyway, Nim is a programming language which has an implementation which supports native code generation (or more precisely an implementation which supports C source code generation) and whose syntax is a hybrid between Wirthian style (by the looks of it the most important influences are Oberon and Delphi) and Python.

However, the fact that it has Pythonic syntax isn't going to help you at all if you don't like European style language design or Wirthian style OOP.

like image 25
Jörg W Mittag Avatar answered Sep 21 '22 11:09

Jörg W Mittag