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

support Scala Native #508

Merged
merged 1 commit into from
Mar 19, 2017

Conversation

aoiroaoino
Copy link
Collaborator

first support: core, state

> show coreNative/nativeMissingDependencies
[info] * @java.net.URI
[info] * @java.net.URI::init_class.java.lang.String
[info] * @java.net.URI::toString_class.java.lang.String
[success] Total time: 4 s, completed 2017/03/17 0:27:58
> show stateNative/nativeMissingDependencies
[info] *
[success] Total time: 1 s, completed 2017/03/17 0:28:05
> show testNative/nativeMissingDependencies
[info] *
[success] Total time: 1 s, completed 2017/03/17 0:28:16

we need remove java.net.URI ...? 🤔 /cc @densh @MasseGuillaume
https://github.com/julien-truffaut/Monocle/blob/v1.4.0/core/shared/src/main/scala/monocle/std/String.scala#L35-L36

@julien-truffaut
Copy link
Member

Nice! About java.net.URI does it mean it would blow up at runtime or compile time if you try to use URI natively?

@xuwei-k
Copy link
Collaborator

xuwei-k commented Mar 17, 2017

I think compile time

@aoiroaoino
Copy link
Collaborator Author

runtime ...?

object Main {
  ...
  val uri = monocle.std.string.stringToURI.getOption("http://example.com")
}
> testNative/compile
[info] Compiling 1 Scala source to /Users/aoino/git/Monocle/testNative/target/scala-2.11/classes...
[success] Total time: 1 s, completed 2017/03/17 20:00:50
> testNative/run
[info] Linking NIR (623 ms)
[error] cannot link: @java.net.URI
[error] cannot link: @java.net.URI::init_class.java.lang.String
[error] cannot link: @java.net.URI::toString_class.java.lang.String
[error] unable to link
[error] (testNative/*:nativeLink) unable to link
[error] Total time: 1 s, completed 2017/03/17 20:00:53

@xuwei-k
Copy link
Collaborator

xuwei-k commented Mar 17, 2017

The run task depends on the nativeLink task

Your cannot link error is during nativeLink task, not runtime.

  • compile or package: create .nir files from "Scala sources". no errors if there is MissingDependencies
  • nativeLink: create executable binary file from .nir files. error if there is MissingDependencies

@julien-truffaut
Copy link
Member

Ok so it means, you will not be able to use stringToURI in native but as you cannot deal with java.net.URI natively, I don't think it will be an issue.

@julien-truffaut
Copy link
Member

👍

@aoiroaoino
Copy link
Collaborator Author

@julien-truffaut @xuwei-k
thanks!

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

Successfully merging this pull request may close these issues.

3 participants