Skip to content
Discussions/App Development/Newby Scala question: can I use your library written in Scala 2 in my project I want to write in Scala 3?Forum ↗

Newby Scala question: can I use your library written in Scala 2 in my project I want to write in Scala 3?

App Development4 posts229 views3 likesLast activity May 2023
GY
gyorgybalazsiOP
May 2023

I want to use the Daml LF Interface library which says was written in Scala 2.13: https://mvnrepository.com/artifact/com.daml/daml-lf-interface

For my code, I would prefer Scala 3 since it’s advertised as superior.

ST
Stephen
May 2023

First, I should mention that you probably want api-type-signature instead beyond a certain version of Daml. This is the new name of the interface library.

Second, I’m sure you saw this if you reviewed the prior discussions, but api-type-signature is technically an internal library, though, again, you probably saw my argument why it is worth using anyway.

Finally, to answer your question, as explained in Scala 3 docs, it is possible to depend on a Scala 2.13 library from a Scala 3 project. I suggest following this path.

ST
stefanobaghino-da
May 2023
Stephen:

First, I should mention that you probably want api-type-signature instead beyond a certain version of Daml.

I believe this is valid from Daml 2.6, to be clearer. The library has been renamed to avoid confusion with Daml interfaces, which the library is capable of handling but are not its only focus.

GY
gyorgybalazsi
May 2023

Thank you, Stephen!

← Back to Discussions