Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import golang packages eco-system #98

Open
avelino opened this issue Jun 10, 2018 · 2 comments
Open

import golang packages eco-system #98

avelino opened this issue Jun 10, 2018 · 2 comments

Comments

@avelino
Copy link

avelino commented Jun 10, 2018

Retro compatibility with native Golang packages

(goimport "fmt")

(fmt.Println "Hello, world!")

We can create a keyword for this import, example goimport
We were able to use all Golang's eco-system inside the rumlang, we would have many batteries included.

Look how it was implemented: https://github.com/goby-lang/goby/blob/83e063d807b73d7d41b6cf3875ed037def104886/vm/plugin_integration_test.go
goby presentation-15

more info: https://goby-lang.gitbooks.io/goby/content/plugin-system.html

@raviqqe
Copy link
Member

raviqqe commented Jun 11, 2018

The challenge here is how to associate Cloe's data types with Go's because the former is similar to JSON and quite different from the latter. Moreover, Cloe doesn't support method calls as it's dedicated to functional programming rather than object-oriented one. However, I'm definitely sure that something simple like the fmt.Println works in Cloe as well as Goby. Thank you for your suggestion! I will investigate it soon.

@avelino
Copy link
Author

avelino commented Jun 11, 2018

fmt.Println It was an example. The idea is to enjoy external packages of the Go eco-system, example:

(goimport "github.com/avelino/slugify")

(slugify.Slugify "Hello, world!")

STDOUT: hello-world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants