Skip to content

Instantly share code, notes, and snippets.

@jtickle
Last active August 29, 2015 13:57
Show Gist options
  • Save jtickle/9419951 to your computer and use it in GitHub Desktop.
Save jtickle/9419951 to your computer and use it in GitHub Desktop.
Compilable and Interpretable GFM
# Hello Class
This class exposes an interface "sayHello" that says hello.
If someone wrote a utility called 'gfmc', it would be a compiler that compiles whatever you put in code blocks in whatever language you specified and puts them in sensible places.
I don't think this is actually possible but you get the idea. It may not have any value at all, but then again it might if you want to make an API to your thing in every language anyone's ever heard of.
```php
class Hello {
public function sayHello() {
echo "Hello!\n";
}
}
```
```python
class Hello:
def sayHello(self):
print 'Hello!'
```
```ruby
class Hello
def sayHello
print "Hello!"
```
```java
public class Hello {
public void sayHello() {
System.out.println("Hello!");
}
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment