Skip to content

Updates and remove redundant settings #101

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keynmol
Copy link

@keynmol keynmol commented Feb 13, 2025

  1. Update versions (scala 3 lts, native version)
  2. Remove redundant native config settings – not only were the comments and values out of sync, but I think it's best to provide a minimal config relying on defaults.
  3. Enable source level debugging – for nicer stacktraces and debug information.
  4. Use Scala 3 syntax

@@ -10,7 +10,7 @@ import scala.scalanative.build._

// defaults set with common options shown
nativeConfig ~= { c =>
c.withLTO(LTO.none) // thin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were here to help people with these basic settings (using the defaults) with some suggestions in the comments for settings you might want to select - maybe the comments where not explained well but that was deliberate as the first thing people asked for was how to optimize and such.

@@ -1 +1 @@
sbt.version = 1.10.6
sbt.version = 1.10.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that a later PR (perhaps #109) has superseded this change.

@@ -1,4 +1,4 @@
scalaVersion := "3.3.3" // A Long Term Support version.
scalaVersion := "3.3.5" // A Long Term Support version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A timely & positive edit when created but Overcome By Events: PR #109.

@@ -1 +1 @@
sbt.version = 1.10.6
sbt.version = 1.10.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by PR #109

Copy link
Contributor

@LeeTibbert LeeTibbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be two parts of this PR which it would be nice to see
be merged.

The "overcome by events" portions had merit at the time they were created and
afterwards because they documented what needed to be updated.

@@ -1 +1 @@
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.6")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A merciful and well needed update at the time of creation but
now superseded. I believe the current template uses 0.5.8.

def main(args: Array[String]): Unit =
println("Hello, world!")
}
@main def hello = println("Hello world from Scala Native!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I, for one, like this change and would like to see it proceed.

Not an earth shaking changes, but I have "Hello world", of various
flavors, popping into my log files all over the place. Always nice to
know who is speaking, just like radio protocol.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was none lto because it was failing on the Mac. As long as we have a NativeConfig so the user doesn't have to figure out that ceremony I am good.

c.withLTO(LTO.none) // thin
.withMode(Mode.debug) // releaseFast
.withGC(GC.immix) // commix
c.withSourceLevelDebuggingConfig(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the current nativeConfig section, with the alternatives
can be preserved and the right hand comment changed to something
like "// frequent alternative 'foo'".

The problem with minimalism, especially for people just joining the party, is the balance between how may people a comment gains and how many people it looses/confuses. I'd ask to be given Wisdom but
I am afraid that is something that must be earned.

As one voice among many, I like having that section, with some alternatives and use both it and the alternative quick reference all the time "now, once again, is that releaseFast or release-fast?"

.withMode(Mode.debug) // releaseFast
.withGC(GC.immix) // commix
c.withSourceLevelDebuggingConfig(
SourceLevelDebuggingConfig.enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never used this feature. What does it do?
What is it's overhead? Does it need to be backed off or
output stripped for an application release?

Since it is non-default, perhaps it could be put either as a comment
block stating that developers find it useful, with a link to the
section in the "User's Guide".

Another alternative would be, if overhead in eventual binary is low,
to have another code block which either enables it or shows it
as the default disabled and suggests, as a step beyond "Getting Started" that one read the URL link and enable it.

I think that Eric formulated the idea of having a README of links
to more advanced .g8 templates actually used by experienced developers. Perhaps we could salt it with an "Once you have gotten started" intermediate template (perhaps showing C "-v" verbose options or such.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Folks, Where do we go from here?

I am hoping that "Hell in a handbasket" is not one of the suggestions.

Thanks,
Lee

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hoping that "Hell in a handbasket" is not one of the suggestions.

Must be getting late there. :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used to (attempt to) teach young adults. They taught me to never ask an
open ended question if you were not willing to accept all answers offered ;-)

@ekrich
Copy link
Member

ekrich commented Jul 16, 2025

Totally agree but in this case I am not picky - Wanted to give them a template with the defaults and hints on what they may need - when everything is new even basic settings are what? huh? And then Anton adds the source debugging which is probably worth a Master's thesis.

@LeeTibbert
Copy link
Contributor

Riffing off what you said. Perhaps something like:

  • .withMode(Mode.debug) // advanced option: releaseFast

  • .withMode(Mode.debug) // advanced hint: releaseFast

  • .withMode(Mode.debug) // 1+: releaseFast

I think folks can wordsmith the right hand part until the cows come home and into
the wee hours of the morning. IMO, we should pick something and run with it
for a while. All of us are short on time and there are, again IMO, bigger issues
afoot. Such as providing a true intermediate template or the READ_ME list of
links to such.

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