Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Li Haoyi
    @lihaoyi
    D:
    D: D: D:
    it looks like parsing is broken
    :(
    Peter Niederwieser
    @pniederw
    my updated port behaves exactly as the original => today's goal achieved
    Peter Niederwieser
    @pniederw
    filed lihaoyi/fansi#7 for the above
    Li Haoyi
    @lihaoyi
    Fixed in 0.2.1 lihaoyi/fansi@abd3639
    Peter Niederwieser
    @pniederw
    @lihaoyi thanks!
    Guillaume Massé
    @MasseGuillaume
    hey I sucessfully compiled fansi and other libraries to scala-native
    Li Haoyi
    @lihaoyi
    nice
    Guillaume Massé
    @MasseGuillaume
    it will be nice to see all those libs ported :)
    Li Haoyi
    @lihaoyi
    yeah
    if it can run on Scala.js
    it really should be able to run on native
    Guillaume Massé
    @MasseGuillaume
    yeah well it's not always possible
    but stuff that works only in the jvm can work on native too
    like jawn for exampl
    you depend on it with pickle
    I ported it too
    Li Haoyi
    @lihaoyi
    good point
    does native have a good package publishing story yet?
    if it does we should get this stuff into CI and publish it all
    Guillaume Massé
    @MasseGuillaume
    it's not yet ready I would say
    Li Haoyi
    @lihaoyi
    after all travis is free :P
    Guillaume Massé
    @MasseGuillaume
    but not far
    I wrote this
    but I should also fix: scala-native/scala-native#370
    otherwise it would overide the jvm artifact :P
    you can also start thinking about crosspublishing to Dotty
    there is a lot of macros in upickle so it's not possible
    yet
    Li Haoyi
    @lihaoyi
    yeah the macros are :scream:
    Guillaume Massé
    @MasseGuillaume
    yep
    Li Haoyi
    @lihaoyi
    most of my libraries also depend on sourcecode, but that should be easy to hack into the compiler if so desired
    Guillaume Massé
    @MasseGuillaume
    you will have to rewrite them
    there is good progress on dotty macro paradise
    it's called Eden
    Bruno Bieth
    @backuitist
    @cvogt a while back I wrote this https://github.com/backuity/ansi-interpolator
    Jan Christopher Vogt
    @cvogt
    nice @backuitist :)!
    renghen
    @renghen
    @renghen
    hi is there a way t have color coding for inner closures ???
    i mean that each inner closure gets a differnt background color ???
    @tksfz
    @tksfz
    hi. is there an equivalent to python's isatty somewhere in this library? if not, isn't that pretty important, or am i missing something? (i think it might exist in jansi)
    @tksfz
    @tksfz
    apparently the cheap way to do it is just System.console() != null
    Li Haoyi
    @lihaoyi
    @/all 0.2.5 is out, which supports scala-native
    Glavo
    @Glavo
    https://github.com/lihaoyi/fansi/blob/master/fansi/shared/src/main/scala/fansi/Fansi.scala#L3643 Why does the join method use a loop instead of System.arrayCopy to copy arrays?
    Li Haoyi
    @lihaoyi
    it was faster when i benched it
    Glavo
    @Glavo
    https://github.com/lihaoyi/fansi/blob/master/fansi/shared/src/main/scala/fansi/Fansi.scala#L369 I think that constructors can be used directly to construct objects , avoiding redundant copy operations
    Li Haoyi
    @lihaoyi
    maybe. if performance is causing issues for you, send a PR with benchmarks
    Nicholas Boyd Isacsson
    @nichobi

    Hi! Trying to turn this "\u001B[48;2;224;48;45mHello!" into a fansi.Str leads to negative values in the color array, and an ArrayIndexOutOfBoundsException when calling render. Printing the raw string works fine and prints "Hello!" with an orange background. Here's the error in ammonite:

    @ fansi.Str("\u001B[48;2;224;48;45mHello!") 
    res3: fansi.Str = Str(
      Array('H', 'e', 'l', 'l', 'o', '!'),
      Array(-536870912L, -536870912L, -536870912L, -536870912L, -536870912L, -536870912L)
    )
    
    @ res3.render 
    java.lang.ArrayIndexOutOfBoundsException: -2
      fansi.ColorCategory.lookupAttr(Fansi.scala:899)
      fansi.Category.lookupEscape(Fansi.scala:663)
      fansi.ColorCategory.lookupEscape(Fansi.scala:891)
      fansi.Attrs$.emitAnsiCodes0(Fansi.scala:534)
      fansi.Str.render(Fansi.scala:147)
      ammonite.$sess.cmd4$.<init>(cmd4.sc:1)
      ammonite.$sess.cmd4$.<clinit>(cmd4.sc)

    I've got as far as figuring out something's going wrong in the Str.apply method, but I haven't been able to figure out why the colour values end up negative. The high performance code is pretty hard to get a grasp of. Anyone got any pointers?

    Li Haoyi
    @lihaoyi
    nope, it's all in that one file. you'll have to puzzle it out