Giter Site home page Giter Site logo

Comments (14)

alixander avatar alixander commented on May 21, 2024 1

rogchap/v8go#350

from d2.

alixander avatar alixander commented on May 21, 2024 1

we can close this now that goja's worked.

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

Another possible approach is to compile with qemu. I believe this is how code-server now handles cross compilation.

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

On nvm, qemu would help us avoid needing to maintain a builder of each architecture and OS but we'd still need one of each OS at the least. I don't think there's any easy way to cross compile for a different platform apart from using zig which I'll need to research further.

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

Relevant: rogchap/v8go#170

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

https://xeiaso.net/blog/carcinization-golang

we could also compile v8 to wasm and execute in a pure go wasm runtime instead. then no cgo at all!

from d2.

Vaelatern avatar Vaelatern commented on May 21, 2024

This currently fully breaks build on musl, including of the d2 command itself (not just d2plugin-dagre).

Is there no easy way to cut this out and require e.g. a library to be present on the system, or something else like that?

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

d2 imports d2plugin-dagre by default. But the d2 command itself is pure Go. You can use --tags nodagre to build without dagre. See

//go:build cgo && !nodagre

or CGO_ENABLED=0 go build ...

The only pure Go layout engine we currently have is TALA which requires a license. See https://github.com/terrastruct/tala

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

@alixander damn nice how did you know that someone opened a PR fixing it?

from d2.

alixander avatar alixander commented on May 21, 2024

i brieflyz considering calling React from Go for server side renders (probably won't go with that), and the potential extra reliance on v8go made me investigate its activity.

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

Can also try https://github.com/dop251/goja?

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

Also means it will be far easier to do #136 when there's no cgo involved.

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

Ok maybe not far given the dagre/elk javascript can just run in the browser lol.

from d2.

nhooyr avatar nhooyr commented on May 21, 2024

omg what if we just embedded the node binary? code-server used to do this thing where they embedded the node binary/js into a single binary. they probably still do. we could do it too.

from d2.

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.