Giter VIP home page Giter VIP logo

Comments (9)

andyarvanitis avatar andyarvanitis commented on July 3, 2024

I haven't done anything with go modules yet. From what I had read, I believe you are right that the generated imports will need to include the module name. I anticipate having a switch on psgo to enable/disable use of modules.

from purescript-native.

andyarvanitis avatar andyarvanitis commented on July 3, 2024

I've been looking into modules now, and believe I have something working the way I'd like, although it might still need some tweaking. If you are pretty familiar/comfortable with go modules, you can try building psgo out of the golang-modules branch. If not, you can wait until I release it and provide instructions. However, the main "quick start" difference is that you don't need to manually clone purescript-native-go-ffi anymore.

Based on what I've been reading, I'm not sure I'll support both a GOPATH and modules mode, but I'll continue to give it some thought.

from purescript-native.

andyarvanitis avatar andyarvanitis commented on July 3, 2024

The latest version of psgo now uses Golang modules instead of GOPATH: 57f696b and (release 2019-08-12).

from purescript-native.

pmahoney avatar pmahoney commented on July 3, 2024

That's great @andyarvanitis , can't wait to get a chance to try it out.

from purescript-native.

andyarvanitis avatar andyarvanitis commented on July 3, 2024

Great, thanks. I'll leave this open until at least you've had a chance to try it. I also need to add some documentation on how to do custom FFI.

from purescript-native.

pmahoney avatar pmahoney commented on July 3, 2024

Successfully built a "hello world"!

I did have to include two replace directives in my toplevel go.mod:

module github.com/pmahoney/example

replace purescript-native/output => ./output

replace purescript-native/ffi-loader => ./purescript-native

Is that expected? Seems reasonable enough.

Thanks, this is great; looking forward to doing something beyond "hello world"!

from purescript-native.

andyarvanitis avatar andyarvanitis commented on July 3, 2024

from purescript-native.

andyarvanitis avatar andyarvanitis commented on July 3, 2024

I made it a little more robust now. If you had already created a go.mod in your working directory, it will still add those replace directives (it now uses go mod edit commands). The latest code in branch golang has this change, but I haven't updated the prebuilt binaries yet.

from purescript-native.

andyarvanitis avatar andyarvanitis commented on July 3, 2024

2019-09-02 prebuilt binaries have this fix, so closing

from purescript-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.