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

scala 3 port #2

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

scala 3 port #2

wants to merge 1 commit into from

Conversation

jportway
Copy link

@jportway jportway commented May 8, 2023

quick conbversion so it compiles and runs under scala 3. There are probably more elegant ways to do some of this (resolving classtags for instance - I ended up going through adding explicit types to arrays in various places) - but it compiles and runs the examples.

@simerplaha
Copy link
Owner

simerplaha commented May 9, 2023

Thank you for the PR.

It appears that the syntax has become more verbose, which does not seem to improve the existing code.

Might have to rethink the upgrade.

@jportway
Copy link
Author

jportway commented May 9, 2023

Yeah - the main problem seems to be that for some reason the compiler can't resolve class tags for arrays any more (at least in some cases). I'm afraid I didn't have a lot of time to explore the reason why (on a deadline, so I just had to hack together something that worked for me), but I assume this is a problem related to Spire, so maybe they have a solution?

@simerplaha
Copy link
Owner

simerplaha commented May 10, 2023

Maybe, I'm not entirely certain. I haven't had the chance to use Spire with Scala3 yet.

It would also make sense to move entirely to Scala3 and drop 2.13, but IntelliJ's support for Scala3 is still somewhat unstable.

Let's keep this PR open in case anyone else wants to use only Scala3. We can merge it once the issues above have been addressed.

Would you be ok sharing your use-case for using Slack3D? I've been thinking about improving it and adding new features, but I wasn't sure if anyone was using it.

@jportway
Copy link
Author

TBH this is the first time I have used it, but I very often have a need for a relatively quick and simple way to prototype 3D work, or just to display data in 3D. I like to work in Scala if possible, but often find myself working in C++ or Rust or Unreal engine, just because there simply isn't much support for graphics stuff in Scala. I had a quick look through Slack3d, and I liked the elegant functional approach, so thought I would give it a try. In this particular case I am using it because I am processing data and generating stuff in Scala (because I like working in that language more) which will eventually be used in Unreal (because it's currently not practical to use Scala to do real graphical work). I do wish it could be Scala all the way down though - I'm not really using the massive depth of Unreal, I'm only using be because it's relatively quick to interactively prototype with.

I do think that Slack3D might benefit from a lot of scala 3 stuff, but I suspect (a feeling only, based on very little evidence) that it might need to be rearchitected significantly to reap the most benefit. See, for instance : this - as far as I know that project is dead, and died before scala3 was finalised, so won't even compile now, but a year or two ago I spent some time hacking at it to get it to work and it was pretty neat - using lots of scala3 compile-time magic to make things really simple to use - but in a way that would be impossible to make compatible with scala 2.

I feel that people attempting 3D stuff tend to avoid JVM based languages due mostly to waryness of garbage collection stalls - but I think perhaps that might be a slightly outdated fear now. I, personally, would really appreciate something like Slack3D, especially if it was architected around a newer API like Vulkan, and super-especially if it could do some of the magical stuff that shady-side was attempting. Whether there is anyone else who has a need for this kind of thing - I have no idea.

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.

2 participants