!EHpcRyNJdgGtwsEwtl:matrix.org

Scala CLI

415 Members
Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run, test, and package your Scala code (and more!) scala-cli.virtuslab.org4 Servers

Load older messages


SenderMessageTime
30 May 2023
@_discord_154558903290560512:t2bot.ioJD557#8432 Ah, thanks
I'll try it again later, then
12:17:50
31 May 2023
@_discord_594749312123142149:t2bot.ioQuafadas#7582 Apologies if I missed this in the docs - couldn't see it, is there a "native" way to read environment variables into a scala-cli script? In mill, you'd use mill-dotenv or similar. Is there a "canonical" solution for scala-cli (other than adding them to the command line)? 11:42:55
@_discord_295204838936150018:t2bot.ioDaenyth#7233 If you're using the typelevel toolkit then (I forget which) either cats-effect or fs2 has an Env api 13:45:46
@_discord_295204838936150018:t2bot.ioDaenyth#7233 and that works cross-platform 13:45:59
@_discord_295204838936150018:t2bot.ioDaenyth#7233 it's cats-effect 13:46:13
@_discord_295204838936150018:t2bot.ioDaenyth#7233 https://typelevel.org/cats-effect/docs/std/env 13:46:32
@_discord_808674836901527612:t2bot.iothanh#9829 I think they ask about reading a .env as environment variables with scala-cli 13:47:36
@_discord_808674836901527612:t2bot.iothanh#9829 * I think they ask about using an .env as environment variables with scala-cli 13:47:52
@_discord_295204838936150018:t2bot.ioDaenyth#7233 ah I misunderstood 13:47:54
@_discord_808674836901527612:t2bot.iothanh#9829 maybe just a just a like export .env && scala-cli run example.scala 13:48:42
@_discord_808674836901527612:t2bot.iothanh#9829 I just made up export .env but I'm sure there is something like that 13:49:06
@_discord_295204838936150018:t2bot.ioDaenyth#7233 source 13:49:10
@_discord_295204838936150018:t2bot.ioDaenyth#7233 ah and the .env would have to have export statements inside 13:49:23
@_discord_295204838936150018:t2bot.ioDaenyth#7233 so not ideal 13:49:36
@_discord_295204838936150018:t2bot.ioDaenyth#7233 I mean there's also the dotenv shell tool 13:49:44
@_discord_295204838936150018:t2bot.ioDaenyth#7233 or uhhhh direnv? 13:49:51
@_discord_295204838936150018:t2bot.ioDaenyth#7233 I think might be the name 13:49:55
@_discord_154558903290560512:t2bot.ioJD557#8432 The FAQ in that page really got me, I was just about to ask here "why is that wrapped in F?" 13:50:04
@_discord_295204838936150018:t2bot.ioDaenyth#7233 indeed heh 13:50:17
@_discord_594749312123142149:t2bot.ioQuafadas#7582 Yup, this was a good notion:
https://stackoverflow.com/questions/72236557/how-do-i-read-a-env-file-from-a-ps1-script

It's interesting working with scala-cli - I need to re-arrange my mental model to make more of it's "cli" nature.
14:12:12
@_discord_594749312123142149:t2bot.ioQuafadas#7582 * Yup, this was a good idea:
https://stackoverflow.com/questions/72236557/how-do-i-read-a-env-file-from-a-ps1-script

It's interesting working with scala-cli - I need to re-arrange my mental model to make more of it's "cli" nature.
14:12:24
@_discord_594749312123142149:t2bot.ioQuafadas#7582 * Yup, this was a good idea, thanks:
https://stackoverflow.com/questions/72236557/how-do-i-read-a-env-file-from-a-ps1-script

It's interesting working with scala-cli - I need to re-arrange my mental model to make more of it's "cli" nature.
14:12:32
@_discord_808674836901527612:t2bot.iothanh#9829 * maybe just a just a script like export .env && scala-cli run example.scala 14:12:54
1 Jun 2023
@_discord_318714777536823299:t2bot.iocarlosedp Hi all, just found-out I can run JMH benchmarks with scala-cli ... is there a flag to generate jmh json output files? 15:35:50
@_discord_318714777536823299:t2bot.iocarlosedp Answering myself... found you can run with a cmdline flag: scala-cli --jmh simplebench.scala -- -rf json 15:52:35
@_discord_295204838936150018:t2bot.ioDaenyth#7233 that's really cool 15:57:58
@_discord_318714777536823299:t2bot.iocarlosedp The resulting json can be thrown into https://jmh.morethan.io/ which is great! 17:57:26
@_discord_295204838936150018:t2bot.ioDaenyth#7233 Do you put the jmh annotations etc in the .scala file, or does it do automatic stuff 18:24:48
@_discord_318714777536823299:t2bot.iocarlosedp https://gist.github.com/carlosedp/a84ff5a4f74ffe02c558ccab324f0886 19:25:55
@_discord_295204838936150018:t2bot.ioDaenyth#7233 very cool! 19:28:09

There are no newer messages yet.


Back to Room ListRoom Version: 9