Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 2019 14:37
    bhaskarmelkani starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 28 2019 15:07
    ishubelko starred lihaoyi/Ammonite
  • Jan 25 2019 22:38
    borissmidt starred lihaoyi/Ammonite
  • Jan 25 2019 17:12

    alexarchambault on 1.6.3

    (compare)

  • Jan 25 2019 17:11

    alexarchambault on master

    1.6.3 (compare)

  • Jan 25 2019 15:48
    alexarchambault commented #923
  • Jan 25 2019 01:15

    lihaoyi on gh-pages

    5ad9ae5538f23cab92ccd8c6b1617d8… (compare)

  • Jan 25 2019 00:50

    alexarchambault on master

    Partly revert 84d48542 (#923) … (compare)

  • Jan 25 2019 00:50
    alexarchambault closed #923
  • Jan 25 2019 00:50
    alexarchambault closed #920
  • Jan 25 2019 00:50
    alexarchambault closed #922
  • Jan 24 2019 23:13
    lihaoyi commented #923
  • Jan 24 2019 22:39
    alexarchambault closed #921
  • Jan 24 2019 22:39
    alexarchambault commented #921
  • Jan 24 2019 22:39
    alexarchambault edited #923
  • Jan 24 2019 22:38
    alexarchambault opened #923
  • Jan 24 2019 22:37
    david-bouyssie commented #919
  • Jan 24 2019 21:33
    nksureshkumar commented #922
Tobias Roeser
@lefou
I'm not 100% sure if this is supposed to work in Ammonite, but in Mill it is
Roberto Leibman
@rleibman
Ah, that sort of makes sense.
Tobias Roeser
@lefou
I meant import $ivy. obviously
Roberto Leibman
@rleibman
Yeah, got that.
Tim Van Wassenhove
@timvw
In previous version of ammonite the followign worked: val x = ammonite.ops.Path(path) ... Now (Ammonite REPL & Script-Runner, 2.5.2) I am greeted with "object ops is not a member of package ammonite" ... Anyone an idea of what is going on?
Tobias Roeser
@lefou
Yeah. Ammonite Ops is discontinued. https://ammonite.io/#2.5.0
Just replace it with OS-Lib
It's the successor of Ammonite Ops
Tim Van Wassenhove
@timvw
Thanks... Simply imported $ivy.com.lihaoyi::os-lib:0.8.0and updated to os.Path and all is working again :)
Tobias Roeser
@lefou
The $ivy import should not be necessary. It's already provided by Ammonite
urbanchr
@urbanchr
Is there a way to force ammonite to use Scala2 or Scala3, preferably using a command line option? At the moment I am using Ammonite Repl 2.5.2 with Scala 2.13.8, but I like to migrate slowly my files to Scala 3 and would love to selectively test whether they work under both versions. Thanks!
Adrian Mocanu
@eamocanu
how can I increase java heap space for ammonite shell? I've been doing a couple of imports and it's OOM
Markus Dale
@medale
@eamocanu start with JAVA_OPTS="-Xmx4G" amm
Emperor Showa
@showa20:matrix.org
[m]
Has anyone run into problems (re)installing ammonite lately? Have the maven artifacts been deleted from repo1.maven.org?
amm
Loading...
Compiling /Users/xxx/.ammonite/predef.sc
java.lang.Exception: Failed to resolve ivy dependencies:Error downloading com.lihaoyi:ammonite-shell_2.13.8:2.5.2
not found: /Users/xxx/.ivy2/local/com.lihaoyi/ammonite-shell_2.13.8/2.5.2/ivys/ivy.xml
not found: https://repo1.maven.org/maven2/com/lihaoyi/ammonite-shell_2.13.8/2.5.2/ammonite-shell_2.13.8-2.5.2.pom
ammonite.interp.Interpreter$DefaultLoadJar.ivy(Interpreter.scala:654)
ammonite.predef.predef$.<clinit>(predef.sc:4)
1 reply
Jason Pickens
@steinybot
Are there any known issues with loading resources from ivy imports in the REPL? I was trying to use OSHI to get some system information and it doesn't work properly. The current theory is that it is not loading oshi.properties from the JAR properly.
Jason Pickens
@steinybot
It turns out this wasn't really a problem with Ammonite. The issue is that import $ivy is adding both the class JAR and source JAR to the class loader so that getResources may find resources in the sources JAR. That does seem a little surprising.
discobaba
@uncleweirdo_twitter
import $ivy.`net.sf.jasperreports:jasperreports:6.19.1`.exclude("com.lowagie" -> "itext")
What is the real syntax for that?
discobaba
@uncleweirdo_twitter
For myself later, probably:
interp.load.ivy(coursierapi.Dependency.of("net.sf.jasperreports", "jasperreports", "6.19.1").
  addExclusion("com.lowagie", "itext"))
@ // necessary to perform the above
bblfish
@bblfish:matrix.org
[m]
I am using " Ammonite Repl 2.5.3 (Scala 2.13.8 Java 18.0.1)"
But I can not use browse
@ browse("hello")
cmd0.sc:1: could not find implicit value for parameter pp: pprint.PPrinter
val res0 = browse("hello")
                 ^
Compilation Failed
I started off with a clean setup (no .ammonite dir)
Is there something I am missing to do here? I could not find it in the online documentation.
bblfish
@bblfish:matrix.org
[m]
There seem to be a few other commands I can't use.
Florian Schmaus
@Flowdalic
@lefou I assume you are aware that the unit tests for os-lib are broken
I was surprised to see that the unit tests do network I/O by invoking curl and that they depend on the content of a remotely changed file. The later probably has changed and now some tests fail
Actually I believe that the network request/response roundtrip of curl contributes a significant ammount of the unit test time of os-lib, so I personally would get rid of it alltogether
slightly related, I wonder if mill (or scalatest?) supports parallel unit test execution
Tobias Roeser
@tobiasroeser:matrix.org
[m]
@Flowdalic: Wrong room. Besides, I was not aware of that. regarding test, mill can run multiple test targets in parallel, scalatest supports parallel tests with -P option.
Kevin Sjöberg
@kevinsjoberg
Hey. :wave: I've just started learning Scala and followed the instructions over at https://docs.scala-lang.org/getting-started/index.html to get started. If I do scala -version I get Scala code runner version 3.1.2 -- Copyright 2002-2022, LAMP/EPFLbut if I runammit says it's usingScala 2.13.8 Java 18`. Why is that? Perhaps my assumptions are wrong, but I thought Ammonite would use the scala version I had available?
This message was deleted
Florian Schmaus
@Flowdalic
@kevinsjoberg I think amm bundles a scala version
hence there is an extra amm binary for every (supported) Scala version per release: https://github.com/com-lihaoyi/Ammonite/releases
Kevin Sjöberg
@kevinsjoberg
I see. How does that work when I'm using https://get-coursier.io?
Florian Schmaus
@Flowdalic
@kevinsjoberg I think very similar, I'd even assume that the release binaries are generated using coursier
All the the universal script at the beginning of the amm binary needs is a (recent enough) Java VM in PATH
Kevin Sjöberg
@kevinsjoberg
Sorry, @Flowdalic, I'm super new to the whole ecosystem, so I didn't quite follow. If I want to launch the Scala 3 version of Ammonite, what would I do? Btw, I also noticed I can do cs launch scalac -- -version and it prints out Scala compiler version 3.1.2 -- Copyright 2002-2022, LAMP/EPFL but if I try to do cs launch amm -- --version I get Cannot find app amm in channels io.get-coursier:apps.
Florian Schmaus
@Flowdalic
Ahh you want to fire up a Scala 3 amm using coursier
I have no idea :) But let's see
coursier gets its information about the amm application probably from https://github.com/coursier/apps/blob/master/apps/resources/ammonite.json
@kevinsjoberg you could cs launch com.lihaoyi:ammonite_3.1.0:2.5.3 -M ammonite.Main
not sure if there is a more idiomatic way
Florian Schmaus
@Flowdalic
another option would be to simply download and execute https://github.com/com-lihaoyi/Ammonite/releases/download/2.5.3/3.1-2.5.3
Kevin Sjöberg
@kevinsjoberg
That worked perfectly! :slight_smile:
Florian Schmaus
@Flowdalic
glad it worked, and welcome to Scala! I hope you enjoy the language, I sure do :)
Kevin Sjöberg
@kevinsjoberg
Thanks, I hopefully will. Btw, what determines what Coursier install by defualt? I did cs setup --jvm temurin:18 and it installed some apps by default. One was amm with the Scala 2 version.
Florian Schmaus
@Flowdalic
I've no idea where the default set of apps is defined nor why the apps are in there, but coursier, mill, Ammonite and probably os-lib seems to be stuff that you typically want to have in the Scala ecosystem
Kevin Sjöberg
@kevinsjoberg
Right. Thanks for the help. Truly appreciate it. :slight_smile:
eric-bzb
@eric-bzb
If I am using VS Code to edit and play with foo.worksheet.sc and I want to import bar.worksheet.sc into scope, is there a special syntax I am missing? import $file.bar.worksheet.sc does not seem to work because it tries to look inside a non-existant directory of ./bar/ Thank you in advance for your help! (edit, could not seem to get the backquotes to escape properly here, but hopefully you understand what I mean)
7 replies