Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 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


  • 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
Dana Borinski
Still not able to solve the issue but im using sbt-ammonite-classpath plugin which looks nice
Peter Aaser
Hey, can anyone help me with the issues I posted about a page up?
In short, I'm trying unsuccessfully to run a compile command
make -j8 PORT_DIR=aptos ITERATIONS=1000 PORT_CFLAGS="-mllvm --aptos-placement=fluid -mllvm -no-aptos-instrumentation -O3 -mllvm -aptos-cp-window-size=20" clean compile link
but I'm getting errors, and frankly I'm not sure where to begin
Peter Aaser
I tried:
compileCommand = """make -j8 PORT_DIR=aptos ITERATIONS=1000 PORT_CFLAGS="-mllvm --aptos-placement=fluid -mllvm -no-aptos-instrumentation -O3 -mllvm -aptos-cp-window-size=20" clean compile link"""
os.proc(compileCommand).call(cmDir, env=env)
however I get error messages that I don't quite understand how to approach
java.io.IOException: Cannot run program "make -j8 PORT_DIR=aptos ITERATIONS=1000 PORT_CFLAGS="-mllvm --aptos-placement=fluid -mllvm -no-aptos-instrumentation -O3 -mllvm -aptos-cp-window-size=20" clean compile link" (in directory "/home/peter/datateknikk/ascenium/github_pinata-consulting_coremark"): error=2, No such file or directory
I don't understand what file the error message is referring to here
In a regular shell I would run the command like this:
$: cd ~/asc/coremark/
$: make -j8 PORT_DIR=aptos ITERATIONS=1000 PORT_CFLAGS="-mllvm --aptos-placement=fluid -mllvm -O3 -mllvm -aptos-cp-window-size=20 -mllvm --aptos-generate-stats-file" clean compile link
where cmDir is ~/asc/coremark/
Peter Aaser
I'm struggling here because I'm unable to narrow down the search space. Simpler commands such as make clean seems to work just fine
Li Haoyi
you need to pass in the string as individual tokens, not as one huge string, as one string means it's looking for an executable whose name matches tthe huge string and of course none exists
I'm guessing "make clean" as one string doesn't work either
this is the same semantics as any other subprocess API (java.lang.ProcessBuilder, python subprocess, etc.)
Peter Aaser
how about the string, should that be as one token?
i.e Array("make", "-j8", .... , "PORT_CFLAGS=\"-mllvm --aptos ... \"", "clean", "compile", "link")?

this is the same semantics as any other subprocess API (java.lang.ProcessBuilder, python subprocess, etc.)

I wasn't aware, but that's very helpful, means it's not ammonite specific

Peter Aaser
I also did try putting it in the environment, but that didn't work out, not sure why.
Seeing as I don't really understand how the makefile is structured I'm not going to tackle that right away
but I'm pretty sure I can figure it out from here, thanks for the help <3 @lihaoyi
Peter Aaser
One thing that would help, is there a way to "print" what a subproccess is set up to do?
  val cflags = "PORT_CFLAGS=\"-mllvm --aptos-placement=fluid -mllvm --aptos-generate-stats-file -O3 -mllvm --aptos-cp-window-size=20\""
  val make = s"make -j8 PORT_DIR=aptos ITERATIONS=1000 $cflags clean compile link".split(' ')
  println(make.mkString(" "))
make -j8 PORT_DIR=aptos ITERATIONS=1000 PORT_CFLAGS="-mllvm --aptos-placement=fluid -mllvm --aptos-generate-stats-file -O3 -mllvm --aptos-cp-window-size=20" clean compile link
which is the exact string I use in the shell
but the result is
make: unrecognized option '--aptos-placement=fluid'
make: unrecognized option '--aptos-generate-stats-file'
make: unrecognized option '--aptos-cp-window-size=20"'
Usage: make [options] [target] ...
now I realize this isn't ammonite specific, I just find it helps to rubberduck and maybe someone else will stumble upon this
Oh, actually that shouldn't come as a suprise since I'm interpolating and then splitting
Li Haoyi
Hi. Is there a way to read a single character from the user, without requiring pressing enter? Like read -n 1 in bash or read -q in zsh?
Siddhant Sanyam
@alexarchambault Thanks for your work on the --class-based mode. I also saw your repo for AmmoniteSpark.
I tried Ammonite (without the --class-based mode and it doesn't work with RDDs which takes lambdas. With --class-based mode it works. So I was wondering, what additional capabilities does AmmoniteSpark enables that aren't possible with vanilla --class-based mode.
2 replies
Naftoli Gugenheim
What's the best CSV library to use in ammonite repl?
Am not a regular Ammonite user, so if these are RTFM let me know.
  1. Is it possible to customize the Ammonite prompt (@) ?
  2. If one has developed a command-line app and it is in a Jar, what is the recommended way to fuse it with ammonite? The idea being that ammonite is like UI for this app (besides the standard ammonite functionality).
I was trying to set up amm for somebody (since it's awesome) but just trying to run the curl, etc command that downloads and starts it, it dumps stack and the terminal kind of goes insane. I suppose it's getting confused and choking the terminal on a bunch of binary crud somehow. Is this something you've seen before?
I moved a jdk over using jar. Maybe I needed to use tar
Simon Parten
@implisci see docs... https://ammonite.io/#Configuration try repl.promt() in your predef
Eitan Adler
I have this code in my application ammonite.Main().run( ) and when I run it I see Compiling (synthetic)/ammonite/predef/ArgsPredef.sc and then it immediately exits
how do I get this to actually drop into a repl?
James Kyle

in my predef.sc, I can use interp.load.cp to load a local jar. However, I can't import and use that jar in the predef.sc itself, only in the repl.

e.g. if I load a jar with classpath, com.safegraph.foo.bar and try to import and use it in predef.sc I get a predef.sc:20: object safegraph is not a member of package com and failed repl startup.

If I load, but not import, I can import and use in the repl

Hello, I'm starting with Ammonite and I'm experimenting the same issue posted in [this] (https://stackoverflow.com/questions/66290176/re-import-a-script-in-ammonite-scala
) stackoverflow question:

import $exec.experiment
hello() //Works
//change script experiment
import $exec.experiment
hello() //fails

it fails with the error:

java.lang.NoClassDefFoundError: ammonite/$sess/experiment$
java.lang.ClassNotFoundException: ammonite.$sess.experiment$
Grégory Weinbach
Is It possible to use most Ammonite features but customize read/eval/print loop (REPL ;-) ) to use an internal DSL ? An example would be welcome :-)
1 reply
Li Haoyi
you can pass in variable bindings to .run, and you can set custom imports in your predef
that should be enough to get the values and methods you want into your REPL
Grégory Weinbach
Thanks for your quick answer.
I actually managed to import the DSL through custom imports but I don't understand how variable bindings will help me change the evalpart (I understand this is the what is under responsibility of the Repl#action()method).
has anybody been able to successfully use a import $plugin.$ivy... statement (such as importing kind-projector) from within a myfilename.worksheet.sc file in VS code?
it works fine in the ammonite REPL itself, but in the worksheet it seems to not be able to fine $plugin so VS Code must be doing something special/non-standard I suppose
Tobias Roeser
In mill we use currently ammonite 2.3.8-4-88785969. Simple forward upgrades didn't succeed because of refactoring in ammonite. Is there any documentation about these changes or can you provide a guide how to migrate?
Alex Fox Gill
hey, how do i insert a tab character in the repl? pressing the tab key just prompts autocomplete
1 reply
Li Haoyi
@lefou @alexarchambault did the refactoring. Mill integrates with Ammonite more deeply than most things, so we'll probably have to dig through the code. It's probably mostly renamings...
3 replies