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

Proposal: dotty front-end #15

Closed
densh opened this issue Feb 28, 2016 · 6 comments
Closed

Proposal: dotty front-end #15

densh opened this issue Feb 28, 2016 · 6 comments

Comments

@densh
Copy link
Member

densh commented Feb 28, 2016

https://github.com/scala-native/scala-native/tree/topic/dotty-support branch of scala-native together with https://github.com/densh/dotty/tree/nir fork of dotty contains initial work to integrate of dotty as Scala Native fronted. This is far from production ready and needs to be updated to reflect recent changes in the NIR.

@densh densh added this to the M2 milestone Feb 28, 2016
@densh densh changed the title Port current frontend to dotty Finish code generator for Dotty Apr 1, 2016
@densh densh modified the milestones: Backlog, M2 Apr 1, 2016
@densh densh changed the title Finish code generator for Dotty Finish dotty front-end May 6, 2016
@densh densh changed the title Finish dotty front-end Proposal: dotty front-end Oct 26, 2016
@densh densh added the feature label Jan 3, 2017
@ekrich
Copy link
Member

ekrich commented May 10, 2018

Was looking into this a bit and found that there is a Dotty (Scala 3) plugin API - http://dotty.epfl.ch/api/dotty/tools/dotc/plugins/Plugin.html

Plugin API ported to Dotty - scala/scala3#3438
Stale sbt plugin code? scala/scala3#4215
Superceded by this? sbt/sbt#4073

Thanks for the help @Blaisorblade

@marcesquerra
Copy link

Is there any plan on working on porting Scala Native to dotty? If there is, is there anything where help might be needed?

I've been thinking for a couple of weeks on Dotty and Scala Native, and I think that combining the two things can provide a very, very interesting language.

As a practical example: dotty's 'opaque types', 'extension methods' and (maybe) 'hard inlining' could make things like CString in SN as performant as in C but with the correct safety

What do you think?

avdv added a commit to avdv/scala-native that referenced this issue Apr 29, 2020
```
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7de4451 in __strlen_avx2 () from /nix/store/6m2k8kx8h216jlx9dg3lp4m90bz05yck-glibc-2.30/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7de4451 in __strlen_avx2 () from /nix/store/6m2k8kx8h216jlx9dg3lp4m90bz05yck-glibc-2.30/lib/libc.so.6
#1  0x00000000005805b2 in _SM33scala.scalanative.unsafe.package$D11fromCStringL28scala.scalanative.unsafe.PtrL24java.nio.charset.CharsetL16java.lang.StringE ()
scala-native#2  0x0000000000658399 in _SM47scala.scalanative.nio.fs.UnixFileSystemProviderD10getUserDirL16java.lang.StringE ()
scala-native#3  0x00000000006583e6 in _SM47scala.scalanative.nio.fs.UnixFileSystemProviderD13fs$lzycomputeL39scala.scalanative.nio.fs.UnixFileSystemE ()
scala-native#4  0x000000000065856a in _SM47scala.scalanative.nio.fs.UnixFileSystemProviderD13getFileSystemL12java.net.URIL24java.nio.file.FileSystemE ()
scala-native#5  0x0000000000755482 in _SM26java.nio.file.FileSystems$D13fs$lzycomputeL24java.nio.file.FileSystemE ()
scala-native#6  0x0000000000754696 in _SM26java.nio.file.FileSystems$D10getDefaultL24java.nio.file.FileSystemE ()
scala-native#7  0x0000000000700809 in _SM20java.nio.file.Paths$D13fs$lzycomputeL24java.nio.file.FileSystemE ()
scala-native#8  0x00000000007008c0 in _SM20java.nio.file.Paths$D3getL16java.lang.StringLAL16java.lang.String_L18java.nio.file.PathE ()
scala-native#9  0x00000000006375fa in _SM34de.bley.scalals.Core$$anonfun$ls$1D5applyL29scala.scalanative.unsafe.ZoneuE ()
scala-native#10 0x00000000006374f8 in _SM34de.bley.scalals.Core$$anonfun$ls$1D5applyL16java.lang.ObjectL16java.lang.ObjectE ()
scala-native#11 0x0000000000680a2b in _SM30scala.scalanative.unsafe.Zone$D5applyL15scala.Function1L16java.lang.ObjectE ()
scala-native#12 0x0000000000670226 in _SM21de.bley.scalals.Core$D2lsL22de.bley.scalals.ConfiguE ()
scala-native#13 0x00000000006d6170 in _SM36de.bley.scalals.Main$$anonfun$main$1D5applyL22de.bley.scalals.ConfiguE ()
scala-native#14 0x00000000006d6116 in _SM36de.bley.scalals.Main$$anonfun$main$1D5applyL16java.lang.ObjectL16java.lang.ObjectE ()
scala-native#15 0x000000000065dfb7 in _SM12scala.OptionD7foreachL15scala.Function1uE ()
scala-native#16 0x0000000000700e47 in _SM21de.bley.scalals.Main$D4mainLAL16java.lang.String_uE ()
scala-native#17 0x0000000000680516 in main ()
```

Note: starting a JVM in an unlinked directory, results in an Error:

```
Error occurred during initialization of VM
java.lang.Error: Properties init: Could not determine current working directory.
  at jdk.internal.util.SystemProps$Raw.platformProperties(java.base/Native Method)
  at jdk.internal.util.SystemProps$Raw.<init>(java.base/SystemProps.java:241)
  at jdk.internal.util.SystemProps.initProperties(java.base/SystemProps.java:54)
  at java.lang.System.initPhase1(java.base/System.java:1997)
```
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Wed Apr 29 22:12:30 2020 +0200
#
# HEAD detached from 6cb2caa
# Changes to be committed:
#	modified:   javalib/src/main/scala/scala/scalanative/nio/fs/UnixFileSystemProvider.scala
#
# Untracked files:
#	javalib/src/main/scala/scala/scalanative/nio/fs/UnixFileSystemProvider.scala_segfault
#
@WojciechMazur
Copy link
Contributor

@marcesquerra sooner or later Scala Native will be working in Scala 3, that's for sure!
But before it happens we need to make sure that it works correctly in Scala 2 and NIR format is stable, otherwise, each bug or feature would need to be addressed twice. That might be an overkill for our relatively small team. There's still a lot of things missing before we can consider it done: multithreading, the final syntax for interop and ABI compatibility, linking as a native library, 32-bit and multiple OS support, etc.

I hope that in the summer of autumn of this year we finally focus on Scala 3 Native.

@He-Pin

This comment has been minimized.

@boggle

This comment has been minimized.

@WojciechMazur
Copy link
Contributor

Dotty / Scala 3 support would be added in 0.4.3

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

No branches or pull requests

6 participants