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 14:37
    bhaskarmelkani starred lihaoyi/Ammonite
  • Jan 29 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 29 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 28 15:07
    ishubelko starred lihaoyi/Ammonite
  • Jan 25 22:38
    borissmidt starred lihaoyi/Ammonite
  • Jan 25 17:12

    alexarchambault on 1.6.3

    (compare)

  • Jan 25 17:11

    alexarchambault on master

    1.6.3 (compare)

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

    lihaoyi on gh-pages

    5ad9ae5538f23cab92ccd8c6b1617d8… (compare)

  • Jan 25 00:50

    alexarchambault on master

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

  • Jan 25 00:50
    alexarchambault closed #923
  • Jan 25 00:50
    alexarchambault closed #920
  • Jan 25 00:50
    alexarchambault closed #922
  • Jan 24 23:13
    lihaoyi commented #923
  • Jan 24 22:39
    alexarchambault closed #921
  • Jan 24 22:39
    alexarchambault commented #921
  • Jan 24 22:39
    alexarchambault edited #923
  • Jan 24 22:38
    alexarchambault opened #923
  • Jan 24 22:37
    david-bouyssie commented #919
  • Jan 24 21:33
    nksureshkumar commented #922
Brandon Elam Barker
@bbarker
Recently, i really wish it were possible to do something like sudo myFun where myFun is an arbitrary JVM function from within my Scala code. But I suppose that would be impossible under the linux security model as it currently stands.
Olivier Mélois
@Baccata
@kubukoz ammonite launchers are released for both 2.12 and 2.13. If you look closely at the one-liner install script, you can see the version appearing in the github URL : http://ammonite.io/#Ammonite-REPL.
https://github.com/lihaoyi/Ammonite/releases <--- here's the artifacts you can pick from
Anton Kulaga
@antonkulaga
I see that GraalVM allows building native images. Has anybody tried to build native immage of ammonite?
Jakub Kozłowski
@kubukoz
nice @baccata, thanks
although the homebrew version installs 2.12
Olivier Mélois
@Baccata
@antonkulaga I don't think that'd be possible, on the account on ammonite relying on some JVM reflection features, which Graal can't translate to native
@kubukoz uninstall ammonite from brew, install it via the one-liner, problem solved :D
Jakub Kozłowski
@kubukoz
yeah, thanks
Bassel
@Shokodemon
does ammonite still phone home ?
Alexandre Archambault
@alexarchambault
@lihaoyi Just saw lihaoyi/Ammonite#984 (which I guess ought not to slow down things compared to before the addition of --thin)
Just so you know, I tend to run Ammonite via other kinds of coursier bootstraps (without jars-in-jars), lightweight ones that rely on the coursier cache. These don't incur perf penalties, and are actually faster than assemblies (I described how I benchmark things, with benchmark results, in this notebook).
These could be used instead of the assemblies that are pushed to github.
Li Haoyi
@lihaoyi
sounds good, i think as a default just sticking with dumb assemblies might be the best thing for now, just to fix the regression
after the fix, we can then consider fancy additional stuff separately :)
There is some understandability downside going from bog-standard-classloader-isolation, 1995-style, to a new bootstrap/isolation mechanism.
Alexandre Archambault
@alexarchambault
Yeah I agree on that :|
I intend to document them in more detail soon(ish), along with the new install command of coursier.
Li Haoyi
@lihaoyi
when you use Ammonite yourself, e.g. for embedding into almond, that's a sufficiently specialized use case I think it's ok if you end up bundling it yourself (e.g. shading all the non-api classfiles)
Alexandre Archambault
@alexarchambault
I don't shade stuff in almond, I rely on the lightweight coursier bootstraps (that rely on the coursier cache instead of embedded jars in jars).
Li Haoyi
@lihaoyi
:+1:
megri
@megri
@lihaoyi I just used Ammonite + ujson + upickle + requests to rehydrate an elasticsearch index that got destroyed, from unparsed event data stored in a remote cassandra cluster. Took 1 hour all in all, with no previous experience of requests or ujson. I just wanted to say thank you!
I'm already a patreon but I should probably prod my bosses and ask them to add some themselves.
Li Haoyi
@lihaoyi
glad to hear it!
Srepfler Srdan
@schrepfler
:clap:
Olivier Mélois
@Baccata
Has ammonite dropped support for the 2.11 series ? 1.6.9 doesn't seem to have been published for those
(not that I care about having support, but I'm updating mill with ammonite 1.6.9 and some tests are failing because the repl artifact is missing for 2.11)
Li Haoyi
@lihaoyi
yes
I support two major versions :)
feel free to bump whatever failing mill tests to 2.12
Olivier Mélois
@Baccata
Okeydo 👍
Bassel
@Shokodemon

trying to parse docker logs, and im getting the following throwbale

java.lang.IllegalArgumentException: Unknown ansi-escape at index 3083 inside string cannot be parsed into an fansi.Str
 fansi.ErrorMode$Throw$.handle(Fansi.scala:417)
  fansi.ErrorMode$Throw$.handle(Fansi.scala:405)
  fansi.Str$.apply(Fansi.scala:270)
  fansi.Str$.implicitApply(Fansi.scala:225)
  pprint.Renderer.$anonfun$rec$27(Renderer.scala:136)
  pprint.Result$.fromString(Result.scala:53)
  pprint.Renderer.rec(Renderer.scala:136)
  pprint.Renderer.$anonfun$rec$15(Renderer.scala:97)
  scala.collection.Iterator$$anon$10.next(Iterator.scala:448)
  pprint.Util$ConcatIterator.check(Util.scala:32)
  pprint.Util$ConcatIterator.hasNext(Util.scala:40)
  pprint.Util$ConcatIterator.check(Util.scala:29)
  pprint.Util$ConcatIterator.hasNext(Util.scala:40)
  pprint.Util$ConcatIterator.check(Util.scala:29)
  pprint.Util$ConcatIterator.hasNext(Util.scala:40)
  pprint.Util$ConcatIterator.check(Util.scala:29)
  pprint.Util$ConcatIterator.hasNext(Util.scala:40)
  pprint.Util$ConcatIterator.check(Util.scala:29)
  pprint.Util$ConcatIterator.hasNext(Util.scala:40)
  pprint.Util$ConcatIterator.check(Util.scala:29)
  pprint.Util$ConcatIterator.hasNext(Util.scala:40)
  scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:500)
  pprint.Truncated.next(Truncated.scala:93)
  pprint.Truncated.next(Truncated.scala:11)
  scala.collection.Iterator$$anon$10.next(Iterator.scala:448)
  scala.collection.Iterator.foreach(Iterator.scala:929)
  scala.collection.Iterator.foreach$(Iterator.scala:929)
  scala.collection.AbstractIterator.foreach(Iterator.scala:1406)
  ammonite.repl.ReplApiImpl.show(ApiImpls.scala:105)
  ammonite.repl.ReplApiImpl.show$(ApiImpls.scala:92)
  ammonite.repl.Repl$$anon$1.show(Repl.scala:76)
  ammonite.repl.ReplApiImpl.show(ApiImpls.scala:88)
  ammonite.repl.ReplApiImpl.show$(ApiImpls.scala:88)
  ammonite.repl.Repl$$anon$1.show(Repl.scala:76)
  ammonite.$sess.cmd125$.<init>(cmd125.sc:1)
  ammonite.$sess.cmd125$.<clinit>(cmd125.sc)

is there any way i could preprocess the strings and get rid of those characters?

Bassel
@Shokodemon
i realized i can circumvent the errors using lines.map(line => (printf("s", line))
Li Haoyi
@lihaoyi
easiest would be to just println them yourself
you could also customize repl.pprinter to not try to be clever with strings, but that's more work (not that much more tho)
Andrew Richards
@ajrnz

Does the ammonite/mill's import $ivysyntax have anything equivalent to sbts classpathTypes which lets you import extra types of artifacts (just just jar/source etc)?
I am unable to use:

import $ivy.`org.vafer:jdeb:1.7`

because it declares its artifact to be type maven-plugin (not jar) and is ignored by coursier.

In sbt you can fix this with:

classpathTypes += "maven-plugin"

Any workaround?

Olivier Mélois
@Baccata
@ajrnz if you manage to download the artifact "manually" (there might be an option in the coursier API, otherwise you'll have to build the http request by hand), then you can call upon the interp api to load stuff into the classpath. That artifact is then taken into account for the compilation of the next stage of your script (or the downstream scripts) : http://ammonite.io/#Multi-stageScripts
Andrew Richards
@ajrnz

@Baccata Yeah that works. Not pretty though:

coursier fetch org.vafer:jdeb:1.7

and then

import $ivy.`org.vafer:jdeb:1.7`
interp.load.cp(Seq(os.Path(coursier.cache.CacheDefaults.location + "/https/repo1.maven.org/maven2/org/vafer/jdeb/1.7/jdeb-1.7.jar")))
@

It not obvious how/where you would insert this into the ammonite code

Vladyslav Pekker
@agilesteel

hi I just downloaded ammonite for the first time and am trying out the source command which doesn't seem to work at all

@ source(Some(1).map(identity)) 
Unable to find sourcecode for class scala.Option

is this a known issue? I'm on Ubuntu 18.04 in case that matters

Alexandros Bantis
@ambantis
Hi, I'm running ammonite 1.6.6 (2.11.12). How do I have the ammonite script exit with a non-zero exit code?
Olivier Mélois
@Baccata
@ambantis you can always call System.exit(1)
Bassel
@Shokodemon
hello all

i would like to use repl.sess.save and repl.sess.load in my scala code, - they are visible from the predef, but i would like to use them inside a class that belongs to a different package.

from what i understand, they become available after the shell is started with Main(), but id like the following piece of code to compile as well"

//  def getArtificats(
//                                                        service: String,
//                                                        serviceVersion: String,
//                                                        serviceDependencyVersion: String,
//                                                        namespace: String
//                                                      ) {
//
//
//    val sessionTag = s"$service:$serviceVersion:$serviceDependencyVersion"
//    repl.sess.save(sessionTag)
//
//    val dep = coursier.
//      Dependency(
//        coursier.Module(namespace, service),
//        serviceVersion,
//        attributes = coursier.Attributes(classifier = "fat")
//      )
//
//    printf(s"finished fetching dependencies for $service-$serviceVersion with dependencies from version $serviceDependencyVersion")
//    repl.sess.load(sessionTag)
//    printf(s"session $sessionTag restored ")
//  }
Bassel
@Shokodemon
not found: value repl
[error]     repl.sess.save(sessionTag)
[error]     ^
i am using ammonite 1.3.3 and importing as a dependency in SBT, and initializing it via Main(). .
Christopher Davenport
@ChristopherDavenport
Is there a trick to run this with 2.13 presently that I’m missing?
Li Haoyi
@lihaoyi
no? the default instructions are for 2.13
it’s on maven central for 2.13
no tricks required
Yann Moisan
@YannMoisan
hello. I have some .sc files. What do you suggest to unit test code in these files ?