Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 02 23:58
    @SethTisue banned @fakubishes:nerdsin.space
  • Dec 15 2021 05:01
    som-snytt commented #12516
  • Dec 15 2021 04:38
    SethTisue edited #1312
  • Dec 15 2021 04:38
    SethTisue opened #2273
  • Dec 15 2021 04:31
    jackkoenig opened #12516
  • Dec 15 2021 04:29
    SethTisue edited #1312
  • Dec 15 2021 04:28
    SethTisue edited #1312
  • Dec 15 2021 04:27
    SethTisue labeled #9831
  • Dec 15 2021 04:27
    scala-jenkins milestoned #9831
  • Dec 15 2021 04:27
    SethTisue labeled #9831
  • Dec 15 2021 04:27
    SethTisue opened #9831
  • Dec 15 2021 03:35
    som-snytt commented #11339
  • Dec 15 2021 03:27
    som-snytt labeled #12494
  • Dec 15 2021 03:07
    SethTisue edited #1312
  • Dec 15 2021 03:07
    SethTisue edited #1312
  • Dec 15 2021 03:05
    SethTisue edited #1312
  • Dec 15 2021 03:05
    SethTisue edited #1312
  • Dec 15 2021 03:05
    SethTisue edited #1312
  • Dec 15 2021 02:58
    SethTisue edited #1312
  • Dec 15 2021 02:58
    SethTisue synchronize #1312
Vasily Kirichenko
@vasily-kirichenko
any hope to make it compilable?
Or I need an Error intermediate case class?
Basile Baranetskyy
@bbb3
@vasily-kirichenko two catch independants does not work?
Peter Aaser
@PeterAaser
T: TotalFailure
me_irl
Dominic Egger
@GrafBlutwurst
@PeterAaser shoot
Christopher Davenport
@ChristopherDavenport
@PeterAaser what are you using?
Peter Aaser
@PeterAaser
Atto
It's all rather basic
I want to parse RISC-V ops
They look like this:
Dominic Egger
@GrafBlutwurst
welp I don't know atto. but I'll still be a rubberduck
Peter Aaser
@PeterAaser
    addi    sp,sp,-32
    sw    ra,28(sp)
    sw    s0,24(sp)
    addi    s0,sp,32
    li    a5,2
    sb    a5,-17(s0)
    lbu    a5,-17(s0)
    mv    a0,a5
    call    isRMS
    mv    a5,a0
    beqz    a5,.L9
lol, pretty colorful
Basile Baranetskyy
@bbb3
I mean two cases:
case MyFirstException(e, ) => println(e)
case MySecondException(e,
)=> println(e)
Peter Aaser
@PeterAaser
I'm pretty much 100% green when it comes to parsing, but here's what I've thought so far
First, instructions don't rely on each other, which is good
one exception is labels, but I handle that in a later pass
Christopher Davenport
@ChristopherDavenport
Ok. I follow so far.
Peter Aaser
@PeterAaser
so I should first make a parser for the opcode (mv, li, beqz et al) which then decides how I should parse the remaining part of the OP
So some function String => Parser[AsmOP]
Here's where I'm getting out of my depth though
In this case a label is a valid AsmOP
Christopher Davenport
@ChristopherDavenport
That would just be flatMap.
Peter Aaser
@PeterAaser
yeah, true
I guess I need a lookuptable for ops
String => Option[?? Parser[OP?]]
Christopher Davenport
@ChristopherDavenport
Or a typeclass for extraction.
Peter Aaser
@PeterAaser
question marks added for confusion pinpointing
Christopher Davenport
@ChristopherDavenport
Also parse it as an option/either, not option of a parser.
As the latter is less compositional.
Peter Aaser
@PeterAaser
Hmm, maybe I should tokenize it
first
Christopher Davenport
@ChristopherDavenport
Likely a good call.
Peter Aaser
@PeterAaser
I mean I did have compiler design back in the day
Christopher Davenport
@ChristopherDavenport
Hard to tell though depending on your case.
Peter Aaser
@PeterAaser
thankfully LALR(1) written in C is not the name of the game anymore :D
Yeh, this is pretty much the first parser I write..
at least asm is pretty easy
Christopher Davenport
@ChristopherDavenport
Here is my cormorant csv parser if that helps at all.
Peter Aaser
@PeterAaser
might be, thanks
Maybe I should read the parser chapter in the red book to get a more fundamental approach
Christopher Davenport
@ChristopherDavenport
I love atto. It's a fun tool.
Peter Aaser
@PeterAaser
How can I cause a parser to fail based on predicate?
Thinking flatMap( x => if(pred(x)) err("reason") else ??? )
Christopher Davenport
@ChristopherDavenport
Failure is one of the options of a parser at any point.
Peter Aaser
@PeterAaser
yes, but I want to have a predicate failure too
I think ok is what I want
Abdhesh Kumar
@abdheshkumar

Anyone has an idea how to override common configuration in included configuration that referenced with environment variable? For example, I have common.conf that has all common configurations and local.conf that override common configurations as per local environment.

common.conf

myapp {
    server-address = ${SERVER_HOSTNAME}
    server-port = ${SERVER_PORT}
}
----------------------
local.conf

include "common"
# override default (Common) settings
myapp {
    server-address = "localhost"
    server-port = 9000
}

while loading local.conf. I am getting below error.

 Could not resolve substitution to a value: ${SERVER_HOSTNAME}
jonathan edwards
@_jedw_twitter
does anyone know what the difference between .contain() and .contains() is?