Skip to main content

First question - is it useful? Not particularly. Trying to make one API that fits a multitude of languages is often a mistaken approach. There are several different programingprogramming types listed in the example:

  • C - classic procedural programming
  • JavascriptJavaScript - multi-padagrimparadigm tending to functional and object oriented
  • Java - Object Oriented.
  • Python - multi-padagrimparadigm tending to object oriented

The way of thinking in each of these languages is particular to that language. One can try to write procedural code in all the languages - completely ignoring polymorphism and just reverting everything to C like struts, but it would not integrate well with others. It would also forgo all the advantages of writing in a higher level language. Passing around dumb objects to static procedures defined somewhere - that is so 1980s.

The question of why really shows up. What practical use would this serve? If I am writing C code, I'm writing C code. Polyglot shops exist, but they are not the norm (it is much easier to hire 6 programmers for one language and get stuff done than it is to hire 1 programmer in each of 6 languages and get the same amount of stuff done). Rarely does one find a programmer that is writing Java and C at the same time where the perceived advantage of having one library API that fits both Java and C could be of a very small advantage.

What you are talking about is implementing a domain specific language (the printSomething(String) of the polyglot API) as a runtime environment in a multiple languages. This isn't impossible, but isn't that useful either. This is harder than one imagines - Python's scope is based on indentation, Javascript's semicolon is a statement separator as opposed to the statement terminator in Java and C (and non-existantexistent in python).

This isn't an impossible task, but really, it isn't that useful.

First question - is it useful? Not particularly. Trying to make one API that fits a multitude of languages is often a mistaken approach. There are several different programing types listed in the example:

  • C - classic procedural programming
  • Javascript - multi-padagrim tending to functional and object oriented
  • Java - Object Oriented.
  • Python - multi-padagrim tending to object oriented

The way of thinking in each of these languages is particular to that language. One can try to write procedural code in all the languages - completely ignoring polymorphism and just reverting everything to C like struts, but it would not integrate well with others. It would also forgo all the advantages of writing in a higher level language. Passing around dumb objects to static procedures defined somewhere - that is so 1980s.

The question of why really shows up. What practical use would this serve? If I am writing C code, I'm writing C code. Polyglot shops exist, but they are not the norm (it is much easier to hire 6 programmers for one language and get stuff done than it is to hire 1 programmer in each of 6 languages and get the same amount of stuff done). Rarely does one find a programmer that is writing Java and C at the same time where the perceived advantage of having one library API that fits both Java and C could be of a very small advantage.

What you are talking about is implementing a domain specific language (the printSomething(String) of the polyglot API) as a runtime environment in a multiple languages. This isn't impossible, but isn't that useful either. This is harder than one imagines - Python's scope is based on indentation, Javascript's semicolon is a statement separator as opposed to the statement terminator in Java and C (and non-existant in python).

This isn't an impossible task, but really, it isn't that useful.

First question - is it useful? Not particularly. Trying to make one API that fits a multitude of languages is often a mistaken approach. There are several different programming types listed in the example:

  • C - classic procedural programming
  • JavaScript - multi-paradigm tending to functional and object oriented
  • Java - Object Oriented.
  • Python - multi-paradigm tending to object oriented

The way of thinking in each of these languages is particular to that language. One can try to write procedural code in all the languages - completely ignoring polymorphism and just reverting everything to C like struts, but it would not integrate well with others. It would also forgo all the advantages of writing in a higher level language. Passing around dumb objects to static procedures defined somewhere - that is so 1980s.

The question of why really shows up. What practical use would this serve? If I am writing C code, I'm writing C code. Polyglot shops exist, but they are not the norm (it is much easier to hire 6 programmers for one language and get stuff done than it is to hire 1 programmer in each of 6 languages and get the same amount of stuff done). Rarely does one find a programmer that is writing Java and C at the same time where the perceived advantage of having one library API that fits both Java and C could be of a very small advantage.

What you are talking about is implementing a domain specific language (the printSomething(String) of the polyglot API) as a runtime environment in a multiple languages. This isn't impossible, but isn't that useful either. This is harder than one imagines - Python's scope is based on indentation, Javascript's semicolon is a statement separator as opposed to the statement terminator in Java and C (and non-existent in python).

This isn't an impossible task, but really, it isn't that useful.

Source Link
user40980
user40980

First question - is it useful? Not particularly. Trying to make one API that fits a multitude of languages is often a mistaken approach. There are several different programing types listed in the example:

  • C - classic procedural programming
  • Javascript - multi-padagrim tending to functional and object oriented
  • Java - Object Oriented.
  • Python - multi-padagrim tending to object oriented

The way of thinking in each of these languages is particular to that language. One can try to write procedural code in all the languages - completely ignoring polymorphism and just reverting everything to C like struts, but it would not integrate well with others. It would also forgo all the advantages of writing in a higher level language. Passing around dumb objects to static procedures defined somewhere - that is so 1980s.

The question of why really shows up. What practical use would this serve? If I am writing C code, I'm writing C code. Polyglot shops exist, but they are not the norm (it is much easier to hire 6 programmers for one language and get stuff done than it is to hire 1 programmer in each of 6 languages and get the same amount of stuff done). Rarely does one find a programmer that is writing Java and C at the same time where the perceived advantage of having one library API that fits both Java and C could be of a very small advantage.

What you are talking about is implementing a domain specific language (the printSomething(String) of the polyglot API) as a runtime environment in a multiple languages. This isn't impossible, but isn't that useful either. This is harder than one imagines - Python's scope is based on indentation, Javascript's semicolon is a statement separator as opposed to the statement terminator in Java and C (and non-existant in python).

This isn't an impossible task, but really, it isn't that useful.