<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")
<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
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>
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