jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
<autodidaddict> yeah, it's all confusing the crap out of me right now. None of this looks like any i/o patterns i'm used to... and I can't figure out how to concatenate a string inside this while loop
* autodidaddict flips a table
<SeanTAllen> what are you trying to do?
<autodidaddict> read a file into a string.
<SeanTAllen> read the entire file into a string?
<autodidaddict> yes, the Pony equivalent of File.readall("./foo.txt")
<SeanTAllen> beat me to the punch
<autodidaddict> oh holy crap
* autodidaddict throws out 20 lines of garbage hackery
<SeanTAllen> sorry, i wasnt helpful, i wasnt aware til right at the end the extent of the question
<autodidaddict> what does Source do?
<autodidaddict> it's not a string
<SeanTAllen> ignore source
<SeanTAllen> file.read_string(file.size()), path.path)
<autodidaddict> ah ok
<SeanTAllen> that reads the entire file into a string
<autodidaddict> that actually doesn't compile
<autodidaddict> hmm. I think my disk just stopped working. that's awesome.
<SeanTAllen> that's odd...
<autodidaddict> the irony of that happening while I'm trying to learn how to do file I/O :D
<autodidaddict> time to buy a new laptop!
<jemc> might wnat to make sure `file.size()` is a reasonable number
<jemc> since you'll be allocating a string of whatever size thaat is
<SeanTAllen> sorry autodidaddict
TheNet has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<SeanTAllen> file.read_string(file.size())
<autodidaddict> I'm getting disk errors during the compile phase, before it gets to my file code
<autodidaddict> ;)
<autodidaddict> other processes are dying too, so it's not Pony
<SeanTAllen> there you go
<SeanTAllen> just for reference
<SeanTAllen> sorry about the computer
<SeanTAllen> dinner time for me
TheNet has joined #ponylang
<autodidaddict> ok, in main I do: let resource_path = FilePath(env.root as AmbientAuth, "./res")
<autodidaddict> and then a few levels deeper, in another actor, I do: try let newPath = FilePath(path, resource) let file = OpenFile(newPath) as File file.read_string(file.size()) else "(not found)" end
<autodidaddict> I'm just trying to read the contents of `./res/motd.txt`
<autodidaddict> argh. I had a leading slash in the filename.. I guess joining FilePaths requires that the second path not include a leading slash
autodidaddict has quit [Ping timeout: 260 seconds]
<SeanTAllen> yeah that's something that should be fixed
TheNet has quit [Quit: Textual IRC Client: www.textualapp.com]
Praetonus has quit [Quit: Leaving]
aceluck has quit []
jemc has quit [Ping timeout: 276 seconds]
amclain has quit [Quit: Leaving]
plietar has joined #ponylang
_whitelogger has joined #ponylang
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
endformationage has quit [Quit: WeeChat 1.7]
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
vaninwagen has joined #ponylang
jemc has joined #ponylang
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
jemc has quit [Ping timeout: 268 seconds]
vaninwagen has quit [Ping timeout: 246 seconds]
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
vaninwagen has joined #ponylang
krakers has joined #ponylang
<krakers> hello again folks, i read the part "why not pony" on the site, it says "If you are writing a single threaded application without any overriding performance concerns...(you should not use pony)" , what strengths will pony bring to a single threaded application?
<krakers> gotta go, but i read the logs if anyone happens to have any input on my question later, thanks! :)
krakers has quit [Quit: Page closed]
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
<Candle> krakers: IMO; you're bound to encounter some form of concurrency in anything that's any more complicated than "hello world".
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
Praetonus has joined #ponylang
samuell has joined #ponylang
_andre has joined #ponylang
autodidaddict has joined #ponylang
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
vaninwagen has quit [Ping timeout: 255 seconds]
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
<autodidaddict> so PonyMUD now has an ASCII art login banner. These are the important things :D
<SeanTAllen> its the little things
<autodidaddict> ASCII art makes me happy
vaninwagen has joined #ponylang
dougmacdoug has joined #ponylang
<SeanTAllen> that's some good ascii art
<autodidaddict> I cheated. There's a generator online that lets you pick a "font", enter text, and it spits out the goodness
<autodidaddict> That font is called Doom
<autodidaddict> http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Type%20Something%20
<SeanTAllen> "cheating" is good
<SeanTAllen> i use a program called monodraw to do ascii diagrams
<vaninwagen> i can really recommend figlet (in combination with lolcat)
plietar has joined #ponylang
plietar has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
jemc has quit [Client Quit]
jemc has joined #ponylang
autodidaddict has quit [Ping timeout: 260 seconds]
amclain has joined #ponylang
vaninwagen has quit [Ping timeout: 246 seconds]
endformationage has joined #ponylang
plietar has joined #ponylang
Matthias247 has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
autodidaddict has joined #ponylang
<autodidaddict> Is there a Pony equivalent of Go's ability to use LDFLAGS to override a package variable at build time? I use this in build pipelines to embed a version number in the compiled binary
plietar has joined #ponylang
<SeanTAllen> If I understand the question, no.
JustVic has joined #ponylang
<SeanTAllen> you can use -DVERSION="1.0.0"
<autodidaddict> In Go, I'd do `-ldflags "-X github.com/foo/bar/baz/config.Version=${VERSION}"`
<SeanTAllen> but ive never tried to access that in anything other than an "ufdef"
<SeanTAllen> "ifdef"
<autodidaddict> and that actually changes the binary so anytime my code refers to `config.Version` is has the compile-time supplied value
<SeanTAllen> we've only ever used to turn features on or or
<SeanTAllen> i think its only available in an "ifdef" statement for tests but, i'm not sure on that
<autodidaddict> Just thinking about a CI pipeline that results in a docker image... would like to have some way of tagging that immutable artifact with a build number/version number/etc
<SeanTAllen> makes sense
<autodidaddict> enterprisey stuff :)
<SeanTAllen> certainly worth a converation
<SeanTAllen> also -D might already support
<SeanTAllen> ive never tried
<SeanTAllen> i dont think it does but... ¯\_(ツ)_/¯
<autodidaddict> it'd be interesting to figure out, especially since Pony doesn't support anything like package globals
<autodidaddict> What I've seen people do in the past is in the build script they just re-write (or generate) a code file prior to compilation that has the version number in it
<SeanTAllen> that would certainly work
plietar has quit [Remote host closed the connection]
samuell has quit [Quit: Hejdå]
samuell_ has joined #ponylang
samuell_ has quit [Quit: Hejdå]
dougmacdoug has quit [Ping timeout: 248 seconds]
<autodidaddict> If I just want to get an array of values out of a map instead of the MapValues[A,B,C] iterator ... is there an easy way to do this?
<autodidaddict> e.g. `mymap.values().???()` ?
<jemc> something like `Array[B].concat(map.values())` should do it
<autodidaddict> nice
<autodidaddict> can't use that.. I ended up having to do `let a = Array[T]` then `a.concat(map.values())` concat is self-mutating and doesn't return a string
<autodidaddict> it'd be nice if there was a way to tell the difference between methods that mutate the receiver and those that don't
<autodidaddict> there's no IDE with intellisense that'll give me the type signatures
<jemc> pony does better than most languages there - a `fun ref` is a method that can mutate
<autodidaddict> yeah but I have to go google up the entry in stdlib to find it
<autodidaddict> and the search capabilities there are awkward at best
<autodidaddict> even with Rust I can hover-over a method call and see the type signature in Atom, VSCode, and Gogland
<SeanTAllen> i keep the pony stdlib source open in the background all the time and refer to it
<jemc> btw you can use `.>` instead of `.` to return the receiver instead of the normal return value
<autodidaddict> other than syntax highlighting, I'm getting nothing from sublime
<jemc> so `Array[B].>concat(map.values())`
<SeanTAllen> sublime can also take you to where things are defined etc, but yes. there's nothing like intellisense
<autodidaddict> hmm I'll try that
<autodidaddict> sweet. got it back down to 1 line
<SeanTAllen> evertthing under "GOTO" should work autodidaddict, as well as GOTO in general works in sublime which is hit or miss
<SeanTAllen> autodidaddict: hopefully at some point, someone comes along and starts working on a Pony Language Server Protocol server
<autodidaddict> Goto does absolutely nothing in sublime
<SeanTAllen> not sure why you say that
<SeanTAllen> works for me
<autodidaddict> Been using sublime for 2 weeks, none of the goto options have done anything
<SeanTAllen> Goto Symbol, Goto Symbol in Project, Goto Defintion all work for me
<jemc> FWIW I don't really tend to use IDE-style features - when I need to look something up I typically read the source of the library I'm using
<SeanTAllen> as well as they have with any other language
<SeanTAllen> the only thing i have installed for that is the pony language package.
<autodidaddict> Don't tempt me on the PLSP thing ;)
<autodidaddict> I do "Goto definition" and it just says "unable to find concat"
<SeanTAllen> It only works on things that are "in the project"
<SeanTAllen> So you'd need to have the standard library open in the project
<SeanTAllen> because that is how sublime works
<autodidaddict> ah, this is my first exposure to sublime. Been using Atom and VSCode for the past 1.5+ years
dougmacdoug has joined #ponylang
<SeanTAllen> but re: stdlib site. i don't think mkdocs layout is good for discovery. even with better search, i still think its meh
<SeanTAllen> that said, i don't have a "better" way
* autodidaddict flips more tables. Yet another refcaps fail
<autodidaddict> calling a function that returns Player ref , trying to store in a variable that is a Player tag
<autodidaddict> actually, it's not even the returns..
<autodidaddict> it's the receiver
<SeanTAllen> i'm afraid i'm not following. if you can do a short example, i should be able to help autodidaddict
<autodidaddict> I'm creating a new command handler that invokes . commandhandlers() on the Player actor
<autodidaddict> in this new command handler, the field is let _parent : Player tag
<SeanTAllen> btw "let _conn: TCPConnection tag "
<SeanTAllen> all actors default to tag
<SeanTAllen> so you only need
<SeanTAllen> let _conn: TCPConnection
<autodidaddict> I cannot do let x = _parent.commandhandlers()
<autodidaddict> or let x:CommandHandlerMap = _parent.commandhandlers()
<SeanTAllen> yes
<SeanTAllen> you can't call a fun ref via a tag
<autodidaddict> but it's a trait
<SeanTAllen> sorry i dont know what you mean
<SeanTAllen> `fun ref commandhandlers(): CommandHandlerMap => _cmdmap `
<autodidaddict> the commandhandlers() function is part of a trait
<SeanTAllen> that doesnt change it being a synchronous method on an actor
<SeanTAllen> what is calling `_parent.commandhandlers()`
<autodidaddict> another actor
<SeanTAllen> what code is doing that?
<autodidaddict> yeah, I see the problem now
<autodidaddict> *facepalm*
<SeanTAllen> did my ducking help at all?
<SeanTAllen> quack quack
TheNet has joined #ponylang
TheNet has quit [Quit: Textual IRC Client: www.textualapp.com]
vaninwagen has joined #ponylang
<autodidaddict> SeanTAllen: this is what I was working on -https://github.com/autodidaddict/ponymud/blob/master/cmd/cmdlist.pony
<SeanTAllen> did you get it?
<autodidaddict> yep
<autodidaddict> works like a champ now that I removed my dumbassery from the picture
<autodidaddict> within a trait (even one on an actor) you can invoke ref funs
<autodidaddict> but obviously outside the actor, it's all a tag so you can't do anything but behaviors
<autodidaddict> so I refactored to a behavior-friendly solution that's in that file in github
autodidaddict has quit [Quit: Page closed]
vaninwagen has quit [Ping timeout: 260 seconds]
vaninwagen has joined #ponylang
_andre has quit [Quit: leaving]
TheNet has joined #ponylang
endformationage has quit [Quit: WeeChat 1.7]
vaninwagen has quit [Ping timeout: 260 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
dougmacdoug has quit [Ping timeout: 240 seconds]
Praetonus has quit [Quit: Leaving]
JustVic has quit [Ping timeout: 260 seconds]
malthe has quit [Remote host closed the connection]
shepheb has quit [Write error: Broken pipe]
malthe has joined #ponylang
shepheb has joined #ponylang
obadz- has joined #ponylang
obadz has quit [Ping timeout: 255 seconds]
obadz- is now known as obadz
TheNet has quit [Quit: Textual IRC Client: www.textualapp.com]