#sadness
What if found one language or framework that is..
Polyglot
pol·y·glot
/ˈpälēˌɡlät/
adjective
1. knowing or using several languages.
noun
1. a person who knows and is able to use several languages.
Polyglot (computing)
In computing, a polyglot is a computer program or script written in a valid form of multiple programming languages, which performs the same operations or output independent of the programming language used to compile or interpret it.
- wikipedia.org
Polyglot written in ANSI C, PHP and bash:
#define a /*
# /dev/null > /dev/null \ ;
// 2> /dev/null; x=a;
$x=5; // 2> /dev/null \ ;
if (($x))
// 2> /dev/null; then
return 0;
// 2> /dev/null; fi
#define e ?>
#define b */
#include
#define main() int main(void)
#define printf printf(
#define true )
#define function
function main()
{
printf "Hello, world!\n"true/* 2> /dev/null | grep -v true*/;
return 0;
}
#define c /*
main
#*/
Polyglot Framework
A programming framework or library that:
- Andrew Grothe
#happiness
// java
import io.vertx.core.AbstractVerticle;
public class Server extends AbstractVerticle {
public void start() {
vertx.createHttpServer().requestHandler(req -> {
req.response()
.putHeader("content-type", "text/plain")
.end("Hello from Vert.x!");
}).listen(8080);
}
}
// javascript
vertx.createHttpServer()
.requestHandler(function (req) {
req.response()
.putHeader("content-type", "text/plain")
.end("Hello from Vert.x!");
}).listen(8080);
// groovy
vertx.createHttpServer().requestHandler({ req ->
req.response()
.putHeader("content-type", "text/plain")
.end("Hello from Vert.x!")
}).listen(8080)
// scala
import io.vertx.lang.scala.ScalaVerticle
class Server extends ScalaVerticle {
override def start(): Unit = {
vertx
.createHttpServer()
.requestHandler(_.response()
.putHeader("content-type", "text/plain")
.end("Hello from Vert.x"))
.listen(8080)
}
}}
const express = require('express');
const app = express();
app.listen(3000);
app.get('/', function(req, res) {
var text = 'Hello World!';
const BigInteger = Java.type('java.math.BigInteger');
text += BigInteger
.valueOf(2)
.pow(100)
.toString(16);
text += Polyglot.eval('R', 'runif(100)')[0];
res.send(text);
})
import org.graalvm.polyglot.*;
public class HelloPolyglot {
public static void main(String[] args) {
System.out.println("Hello Java!");
Context context = Context.create();
context.eval("js",
"print('Hello JavaScript!');");
}
}
You Need a Budget.com
8 languages, 2 DB, 3 frameworks,
3 devops, 5 services, 3+ IDEs
Server: Ruby on Rails, PostgreSQL
iOS: Objective-C, Swift, TypeScript, SQLite
Android: Java, Kotlin, TypeScript, SQLite
Web: Ember, TypeScript, Grunt, webpack
Services: GitHub, Heroku, Amazon Web Services, DigitalOcean, Recurly
DevOps: Ansible, Vagrant, Jenkins
4 Languages, 1 IDE
Slides => https://agrothe.github.io/polyglot-talk/