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
<SeanTAllen> then we can discuss removing "flexibility"
<cquinn> ok, perfect, I agree
<SeanTAllen> thats my take on things
<SeanTAllen> personally i would like to see 1 standard package manager
<cquinn> I guess I am then trying to do two things at once, and maybe that is confusing
<SeanTAllen> i think that would be very good
<cquinn> I agree. I really like Stable and just want to expand on that.
<SeanTAllen> needs windows suport
<SeanTAllen> but ya
<SeanTAllen> its pretty much everything we need a sendence
<SeanTAllen> otoh, i'm not a big package manager person
<SeanTAllen> im sure there are folks who would want more ala cargo
<cquinn> I have worked with packages a lot. in Java and Go lands.
<SeanTAllen> i will state that i hate both maven and ivy
<SeanTAllen> the only thing i like about maven is that its not ivy
<cquinn> I dabbled in Cargo when I played with Rust
<cquinn> lol. I wrote a lot of Ant and Groovy talking to Ivy
<SeanTAllen> it appears that lots of folks want a package manager that is also a build tool
<cquinn> in theory it was good, but overly complex and sneaky bugs
<SeanTAllen> im sure there are pros to that, but i'm not a big fan. i'm one of those awful people who likes Makefiles
<cquinn> I think the package manager and the build tool are best separated
<SeanTAllen> ^5
<SeanTAllen> most innovations in the space leave me cold
<SeanTAllen> i know why cmake and autotools exist (as examples) but they still drive me nuts
<SeanTAllen> we could go the ruby route and write Pake
<SeanTAllen> Pony Make!
<cquinn> each of those are hard problems, and combining them only makes it worse
<SeanTAllen> in general i dont disagree but lots of folks apparently do
<jemc> FWIW, the Ruby equivalent of a package manager is not Rake, but RubyGems
<jemc> but I'm one of those people who uses Makefiles on both my Ruby projects and my Pony projects :D
<cquinn> yeah :)
<cquinn> I guess when the package manager does a good job, the build can be pretty easy
Praetonus has quit [Quit: Leaving]
<jemc> in my Pony workflows, I use my `Makefile` to invoke `stable fetch`
<cquinn> that makes sense. We did that too in Go: 'govendor sync'
<cquinn> in our Makefiles
<jemc> honestly, `Makefile`s are really damn elegant when you're not worrying about dependency management (a la automake)
<jemc> that is, automake is an example of Makefiles getting *in*elegant
<cquinn> exactly. with only a handful of targets Makefiles can be really simple
<cquinn> what are the problems left with Stable that cause it to not work on Windows? The Shell-ing?
<jemc> should just be the shelling
<jemc> should theoretically be quite easy to fix for someone with a windows environment to test against
<cquinn> OK. I will try to address that in what I do.
<cquinn> I have a Windows on parallels on one of my Macs. Though, I just left a job partially because I don't like programming on Windows :)
<jemc> part of the problem is that Pony doesn't have a standard abstraction for "run this shell command", so I was just using the `system` call, which is POSIX-specific
<SeanTAllen> cquinn: you did windows programming at RG?
<cquinn> I was for the last few months working on the game engine for Stonehearth
<jemc> however, I don't know that bringing a shell executor abstraction to Pony is going to be very easy while maintaining some semblance of sensible capability security
<jemc> I mean, you could have some kind of `ShellAuth` derived from `AmbientAuth`, but that's a pretty darn coarse-grained capability
<cquinn> yeah, it might be easier to wrap the git abstraction
<cquinn> smaller problem to solve at least
<jemc> maybe you could do something with the `FileExec` primitive in `file_caps.pony`
<cquinn> yeah
<jemc> that is, you need to have `FileExec` privileges for the `FilePath` to the executable you want to run, before you can run it as a shell command
<SeanTAllen> I would imagine that the route to doing that would be via the process package
<jemc> err dope, look at me, I forgot about the process package
<jemc> probably because it didn't exist when pony-stable was first written
<cquinn> I meant to go dig into that. I take it's more similar to spawn
<jemc> but yeah - that's the ticket - pony-stable should be refactored to use `ProcessMonitor`
<jemc> yeah
<SeanTAllen> unrelated but i love the phrase "that's the ticket", please work into as many conversations as possible
<jemc> :D
<cquinn> yeah, yeah, that's the ticket :)
<jemc> okay, well I'm off to go do some scything in my pasture - good luck with all this
<cquinn> thanks, have fun!
jemc has quit [Quit: WeeChat 1.4]
inv2004 has joined #ponylang
<inv2004> Hello.
<inv2004> var s: Array[U64] = Array[U64].init(0,3)
<inv2004> receiver type is not a subtype of target type s(i) = rand.int(1000)
<doublec> inv2004: are you asking why the error?
<doublec> inv2004: your 'foo' method needs to have the 'ref' capability
<inv2004> I suppose some ref/val . But it is not clear how to fix it
<doublec> inv2004: methods default to box which means they can't call methods on fields that are ref.
<doublec> inv2004: or rather, they can't update fields
<inv2004> Is it about .int() method ? But it is standart library
<doublec> inv2004: so: fun ref foo(e: Env): String
<doublec> inv2004: https://is.gd/4fz7Hr
<inv2004> oh
<inv2004> Thx! I thought that error about .int(...) ref
<doublec> inv2004: the 'this' in "receiver type: this->Array[U64 val] ref" is the clue
<inv2004> Y. It was very strange to see this there :) ok
<doublec> inv2004: it's saying that "Array[U64 val] ref" as seen by "this" is not the same as "Array[U64 val] ref"
<SeanTAllen> fun foo says... this method can be called on mutable or immutable `this` which means, it can not mutate any internal state
<doublec> inv2004: and if you look at the viewport adaption table you can see why: https://tutorial.ponylang.org/capabilities/combining-capabilities.html
<doublec> inv2004: The 'this' in this case is 'box' since that's the default for a method. So box->ref gives box.
<inv2004> Will read, thank you!
<inv2004> I would like to make some microbenchmark comparison with Rust
<doublec> inv2004: cool, post your results here and you might get some advice on improving
<SeanTAllen> you will run into memory pressure if you do a lot in the Main actor
<SeanTAllen> i'd suggest learning the basics of GC before you set off on your microbenchmarks
amclain has quit [Quit: Leaving]
<inv2004> hm. Read and did not understan what problem to expect from Main actor with functions
<inv2004> Is it possible to iterate via two arrays in the same for ? .zip or something like this ?
<doublec> inv2004: if you do your benchmarking in the main actor, and it doesn't call any behaviours, then GC is never done.
<inv2004> doublec, it is even good for test :)
<SeanTAllen> thats not good for testing
<SeanTAllen> if you create memory pressure
<inv2004> Ok. I will write this simple tests, then will ask how to improve it :)
<SeanTAllen> inv2004: are you familiar with pony bench?
<inv2004> I saw mentions of them.
<inv2004> will try to reuse it
<SeanTAllen> also if you are benchmarking, i would strongly suggest you build ponyc and the runtime from source
<inv2004> :( it is not easy
<SeanTAllen> what platform are you on?
<inv2004> win x64
<SeanTAllen> ah yes, thats a little harder
<SeanTAllen> well
<SeanTAllen> the prebuilt packages are built for high cpu compatibility
<SeanTAllen> and as such wont take advantage of a lot of cpu features that you might have
<SeanTAllen> this can have a large impact on performance
<inv2004> I will post this simple tests here and maybe it would be possible to check somethere else. I suppose it is quite easy to have rust somethere.
<inv2004> it is not very clever test: https://is.gd/cUpkpz
<SeanTAllen> clever is never a good thing, so not being a clever test is probably a good thing
<inv2004> :)))
<inv2004> two vectors k and v with big size + one h hashmap with ~10-20 elements. I sum element from v into h for correspondent key
<inv2004> It emulates some kind of select key, sum price from table where key in <something) group by key
<inv2004> <something> - misprint
<inv2004> my mistake
inv2004 has quit [Ping timeout: 260 seconds]
inv2004 has joined #ponylang
<inv2004> ponyc crashed :(
<inv2004> this code: https://is.gd/pQN5US
<inv2004> on the last line
inv2004 has quit [Quit: Page closed]
inv2004 has joined #ponylang
inv2004 has quit [Quit: Page closed]
inv2004 has joined #ponylang
<inv2004> Looks like I stuck with main pony feature :)
<inv2004> If someone will be available - could You please check this code: https://is.gd/xYfMYN
<inv2004> The problem in bench[None]... line.
<inv2004> I will check chat log tomorrow. Thank you.
inv2004 has quit [Quit: Page closed]
<doublec> inv2004: I think the problem is you are aliasing the iso 't' inside the closure.
<doublec> inv2004: There's also the problem that you are calling a 'ref' method inside a box method.
<doublec> inv2004: The 'apply' function of the closure is a 'box'. But 'test1' is ref.
<doublec> inv2004: I don't think the functions passed to 'bench' can be modified as it is called repeatdly.
<doublec> inv2004: This is easier to see if you convert your lambda to the equivalent object literal
<doublec> inv2004: https://is.gd/UeL4Pv
ensrettet has joined #ponylang
<doublec> inv2004: There you ca nsee that the 'apply' method is using the default box and the error states that this->Tests iso is not Tests ref - it is Tests tag
<doublec> inv2004: That's because of viewtype adaption - box->iso is tag.
endformationage has quit [Quit: WeeChat 1.7]
ensrettet has quit [Quit: Textual IRC Client: www.textualapp.com]
_andre has joined #ponylang
M-hrjet has quit [Ping timeout: 246 seconds]
srenatus[m] has quit [Ping timeout: 240 seconds]
dtz has quit [Ping timeout: 276 seconds]
irx[m] has quit [Ping timeout: 258 seconds]
mindB has quit [Ping timeout: 255 seconds]
katafrakt[m] has quit [Ping timeout: 276 seconds]
ada[m] has quit [Ping timeout: 276 seconds]
adam_ has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ponylang
srenatus[m] has joined #ponylang
srenatus[m] has quit [Read error: Connection reset by peer]
srenatus[m] has joined #ponylang
dtz has joined #ponylang
mindB has joined #ponylang
M-hrjet has joined #ponylang
irx[m] has joined #ponylang
katafrakt[m] has joined #ponylang
ada[m] has joined #ponylang
jemc has joined #ponylang
inv2004 has joined #ponylang
<inv2004> https://is.gd/UeL4Pv - shoes error also
<inv2004> shows
inv2004 has quit [Ping timeout: 260 seconds]
<jemc> inv2004: have you read through the tutorial section about reference uniqueness, as it applies to `iso`?
inv2004 has joined #ponylang
<inv2004> I am even now sure if I can call another clear() after bench[] section
<inv2004> uh, Could someone fix it? :) I just wanted to see numbers :)
<inv2004> sorry
<jemc> inv2004: have you read through the tutorial already?
<inv2004> I did it twice!
<inv2004> Manual is clear. But, unfortunately it is still unclear how to pass object to Actor
<inv2004> I mean mutable. It shoould be iso <- clear
<inv2004> because I do not have another actors with it
<jemc> I don't mean any offense, but I think you should take some time to familiarize yourself with the language, getting code to compile, and the language idioms before you try to benchmark it - to be perfectly honest, I'm a bit reluctant to just fix your benchmark for you to get numbers, because you're not going to understand what those numbers mean, or if your code is idiomatic at all
<jemc> I'm happy to answer specific questions about areas you may be confused about
<inv2004> Ok. Let me start: 1st: Why I can have class val with ref methods inside ?
endformationage has joined #ponylang
<jemc> `class val Foo` is a way of declaring a class named `Foo`, saying that anywhere you use the type name `Foo` it will be implicitly expanded to `Foo val` - that doesn't mean you can't ever have a mutable object of that type, it just means that when you use that type name in a type signature and don't specify a cap, the cap will be `val`
<jemc> for example `class val String` is in the standard library, but the main constructor `new ref create` gives you a `String ref`
<jemc> but make no mistake, you cannot call `fun ref` methods on an reference with cap `val`
<jemc> in other words, when you have a `val` reference to something, any mutable methods are inaccessible to you, even if they exist on the type
<inv2004> If I remove bench line, and to simple lambda let l = {() => t.test1()} <- Why I still have errors about receiver? I do not use Actors here
<inv2004> C:\Users\unknoqn\Dropbox\dev\pony\a1.pony:78:24: receiver type: this->Tests iso!
<inv2004> C:\Users\unknoqn\Dropbox\dev\pony\a1.pony:32:5: target type: Tests ref
<inv2004> But it is just a lambda
<jemc> "receiver" is a general term for any object that receives a method call - it may be an actor, class, primitive, etc
<inv2004> ok. its clear that I need to make Tests iso
<inv2004> I have to consume it, But I cannot consume lambda
<jemc> if you need an iso lambda, you can surround it in `recover iso ... end` or add `iso` after the closing `}`
<jemc> either way, you don't need to consume the lambda because there are no named references to it yet - when an object is created, it is ephemeral by nature, until you assign it to a named reference (or pass it to a named parameter, etc)
<jemc> the key thing to remember is that `consume` is used to destroy a named reference
<inv2004> Ok, let me forget about consume
endformationage has quit [Ping timeout: 240 seconds]
adam_ has joined #ponylang
<inv2004> I gave up, did benchmark in Main actor :(
<inv2004> receiver type: this->Tests iso!. what does it mean ?
<inv2004> why this-> ?
inv2004 has quit [Quit: Page closed]
<jemc> `this->X` means "as `this` sees X" - refer to the viewpoint adaptation section of the tutorial for more info
<jemc> it probably means you were trying to do something mutable from a `fun box` (a read-only method), but it could mean something else depending on the context
jemc has quit [Ping timeout: 260 seconds]
inv2004 has joined #ponylang
inv2004 has quit [Client Quit]
endformationage has joined #ponylang
Matthias247 has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
Matthias247 has joined #ponylang
papey_lap has quit [Ping timeout: 255 seconds]
vaninwagen_ has joined #ponylang
_andre has quit [Quit: leaving]
inv2004 has joined #ponylang
inv2004 has quit [Ping timeout: 260 seconds]
pony_ has joined #ponylang
pony_ has quit [Client Quit]
Matthias247 has quit [Read error: Connection reset by peer]
vaninwagen__ has joined #ponylang
vaninwagen_ has quit [Ping timeout: 248 seconds]
vaninwagen__ has quit [Ping timeout: 260 seconds]