Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ktoso/jo
Jo - The JVM based Go implementation
https://github.com/ktoso/jo
Last synced: 29 days ago
JSON representation
Jo - The JVM based Go implementation
- Host: GitHub
- URL: https://github.com/ktoso/jo
- Owner: ktoso
- Created: 2013-05-27T18:11:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-06-16T10:53:52.000Z (over 11 years ago)
- Last Synced: 2024-12-07T01:44:14.287Z (about 1 month ago)
- Language: Java
- Homepage:
- Size: 195 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Jo - The JVM based Go implementation
=====================================**This is a pet project.**
And it should be spelled as "Joe", that is - similiar to "Go" the original language we're reimplementing here.
See the official language page and docs here: golang.org
Does this even work?
--------------------
Somewhat, but it'll get better in time.For now we're able to support Println and returning a `string` from a `func`... ;-)
Examples
--------
Go code using Jo is aimed to be used both, dynamically as you can see here:```scala
it should "return a string from a func" in {
// given
val text = "Hello, 世界"
val source =
s"""package helloworld2
|
|func GetHello() string {
| return "$text"
|}
""".stripMargin// when
val app = JoApp.fromString(source)
val result = app.callUnsafe("GetHello", classOf[String])// then
info("Jo func [GetHello] returned: " + result) // Hello, 世界result should equal (text)
}
```as well as to compile into a fat-jar. But that's pretty much light years away... ;-)
What's inside?
--------------
* The JVM
* Scala as primary impl language
* ANTLR4 as parser generator
* ASM as bytecode generatorOther Go impls on the JVM
-------------------------
You may want to try out: https://code.google.com/p/jgo (funny - he selected the same impl stack :-)).Disclaimer
----------
This is a pet project in order for me to have fun generating bytecode and parsers - I'm fully aware of why/how/when the JVM vs. Go's runtime offer pretty different things.