bedeke
2021-3-25 07:02:19

thx. changing (send (new (my-plain-mixin object%)) test) to (send (new (my-plain-mixin (class object% (super-new)))) test) makes the second part work.

For the first part, if all init’s or init-fields are optional and I don’t use them during instantiation, this works too. But that’s not really what I wanted to achieve :confused: None of the tests in sealing-contract actually try to instantiate an object. Making the classes works fine for me too.


igor.sutton
2021-3-25 10:25:12

@igor.sutton has joined the channel


badkins
2021-3-25 13:27:20

You may get more helpful responses if you ask a more specific question.


laurent.orseau
2021-3-25 16:15:08

For testing, get-pure-port can use the file protocol for url, which avoids network queries


soegaard2
2021-3-25 16:51:44

@joshuahoeflich2021 You could use git-checkout from net/git-checkout. https://docs.racket-lang.org/net/git-checkout.html

It’s implemented in Racket, which means it works on all platforms whether or not git is installed.


joshuahoeflich2021
2021-3-25 16:58:45

Woah! Talk about batteries included, thank you


soegaard2
2021-3-25 17:00:57

The honor goes to Flatt, I believe.


greg
2021-3-25 18:38:02

Another problem is that the deserialized expansion seems to be missing some things related to imports.


robby
2021-3-25 18:38:42

I think we can probably view most of these as bugs to be fixed but perhaps starting an issue where we might discuss them is a good move?


greg
2021-3-25 18:38:45

My little example program showing both problems.


greg
2021-3-25 18:39:12

OK that makes sense!


greg
2021-3-25 18:39:41

Should I make an issue on your repo https://github.com/rfindler/fully-expanded-store ?


robby
2021-3-25 18:39:50

SUre!


robby
2021-3-25 18:40:01

I was thinking Racket but perhaps my repo is better.


greg
2021-3-25 18:40:51

Will do. I suspect someone with the initials M.F. might need to be invited at some point in the discussion. :slightly_smiling_face:


greg
2021-3-25 18:41:15

But I’ll start with an issue on your repo.


robby
2021-3-25 18:41:26

MRF :wink:


robby
2021-3-25 18:41:41

MF might be herr doktor felleisen


sschwarzer
2021-3-25 18:43:55

I’m preparing my first Racket package for a release. :slightly_smiling_face: If you like, please have a look at https://git.sr.ht/~sschwarzer/todoreport-racket/tree and give me feedback. (By the way, I applied a lot of the review feedback you gave me earlier, thanks again!)

Is the README ok or do you miss anything? Note that the package installation as mentioned in the README won’t work yet, as the package doesn’t exist yet and the tag hasn’t been created either.

I read that libraries and tools should be split into different packages, but first I’d like to publish everything in one package and possibly split it later. Besides, I’m still thinking about creating a file that collects the whole user-public API, although I think changes should still be fine as long as I’m below version 1.0.


sorawee
2021-3-25 18:45:38

Well, most packages have doc written in Scribble


sorawee
2021-3-25 18:46:38

And when you upload it to the package server, the doc will automatically be hosted at https://docs.racket-lang.org/


sschwarzer
2021-3-25 18:47:04

@sorawee Ah, right. I haven’t used Scribble yet, but yes, that documentation would be nice to have. Do you think it’s ok to publish the package initially without Scribble docs?


sorawee
2021-3-25 18:47:53

That’s totally fine! Many packages are like that.


sschwarzer
2021-3-25 18:49:27

As it’s my first Racket package and I’m using Racket only in my free time so far, I thought it would be good to publish an “ok” package first instead of raising the bar too high and release nothing.


sorawee
2021-3-25 18:49:28

To create a proper package, you also need info.rkt, I think.


sschwarzer
2021-3-25 18:50:08

If I remember correctly, I read that’s only needed if you install in multiple collections.


sschwarzer
2021-3-25 18:51:28

But then, yes, there’s some information in there that would be good to have, so I’ll add the info.rkt.


sorawee
2021-3-25 18:52:10

Really? I thought you need it for the deps information (which should at least contain base — and possibly more like rackunit-lib) and if you don’t have it, the package server will complain when it builds your package


laurent.orseau
2021-3-25 18:54:22

I wonder if raco setup --fix-pkg-deps creates the info.rkt file


sschwarzer
2021-3-25 18:54:38

@sorawee Yes, I’m already on the info.rkt :slightly_smiling_face:


sschwarzer
2021-3-25 18:55:48

Added and pushed it.


sorawee
2021-3-25 18:58:16

Just to drop two quick tips

  • raco pkg new <your-package-name> will generate a starting template for your package, including Scribble doc and info.rkt.
  • raco setup --fix-pkg-deps --pkgs <your-package-name> that @laurent.orseau mentioned is a really nice command. It will add entries to deps in info.rkt automatically for you.

sschwarzer
2021-3-25 19:01:25

I actually had generated the original info.rkt with raco pkg new. :slightly_smiling_face:

Could it be that raco setup --fix-pkg-deps only works if the package is already installed? I get a stacktrace starting with pkd->collections: package not found


sorawee
2021-3-25 19:01:41

yep, that’s correct


sschwarzer
2021-3-25 19:03:38

Is it common to have a new collection for a package in info.rkt? Otherwise I’d had some trouble to find an existing collection for the package.


sschwarzer
2021-3-25 19:09:29

Ok, I installed the package with raco pkg install ../todoreport locally and ran raco setup --fix-pkg-deps todoreport and don’t see anything suspicious in the output.


sschwarzer
2021-3-25 20:36:47

Oh, I forgot to read the later sections of https://docs.racket-lang.org/pkg/index.html . I’ll need to read this and then modify the package to install todoreport as a binary. Maybe I need to change other stuff as well.


kellysmith12.21
2021-3-25 23:04:17

I’m sorry, I’m not very familiar with the workings of the Garbage Collector, but I’m curious: is there a way to tell the GC, “Hey, this object can probably be collected.”? In particular, with the intent of encouraging more deterministic cleanups.


alexharsanyi
2021-3-25 23:32:25

I am not familiar with any API to mark an object ready for collection, but using (collect-garbage 'incremental) might help with reducing the impact of the GC in a timing sensitive application.


samth
2021-3-26 01:44:42

@kellysmith12.21 if you can refer to the object then it can’t be collected, presumably. So I feel like I’m misunderstanding something.


kellysmith12.21
2021-3-26 01:52:32

I’m considering the hypothetical situation where I’m using an object linearly/uniquely. This means that I can tell the exact point at which the object is no longer reachable.


kellysmith12.21
2021-3-26 01:59:32

I can build a type system to track linear/unique objects, but without a way to inform the GC about this, there’s not as much benefit to such a type system.


jaz
2021-3-26 02:05:56

If this is in your own language, then you could allocate a linearly typed object using the ffi library’s malloc to allocate memory outside of the garbage-collected heap, and you could insert calls to free where the object becomes unreachable.


kellysmith12.21
2021-3-26 02:30:13

I’ll have to look into that.