soegaard2
2021-3-26 07:53:57

@kellysmith12.21 Maybe I am missing something, but if you have (define foo &lt;large-object&gt;) and at some later point, know that <large-object> is no longer needed, you can simply do (set! foo #f) which removes the reference to <large-object>. If you want it garbage collected right now then you can call (collect-garbage) This of course is under the assumption, that foo is the only reference to <large-object>.


soegaard2
2021-3-26 07:55:35

If you are in a situation, where some large object is nice to have around, but only if there is enough memory, you can look at “weak boxes”.


soegaard2
2021-3-26 08:41:18

Check the “Show HN: Invoicer” story on Hacker News. Dexter Lagan is showing an invoice billing app made in Racket.


yanyingwang1
2021-3-26 10:45:03

Hi, guys. I have a question about racket’s package version reference. As I have read from the chapter of Package Sources https://docs.racket-lang.org/pkg/Package_Concepts.html#%28part._concept~3asource%29\|https://docs.racket-lang.org/pkg/Package_Concepts.html#%28part._concept~3asource%29 , my understanding is that racket is mainly using git’s commit references and tags to refer difference release of packages. And from header description of Package Concepts https://docs.racket-lang.org/pkg/Package_Concepts.html\|https://docs.racket-lang.org/pkg/Package_Concepts.html , it says a version defined in the info.rkt file is intended to reflect available features of a package. But as I read the doc further, in the chapter of Package Metadata https://docs.racket-lang.org/pkg/metadata.html\|https://docs.racket-lang.org/pkg/metadata.html , it seems I can also define deps as a list in the info.rkt file_,_ and each element of this list is a form of (list package-source-string keyword-and-spec ...), and there is another keyword '#:version for each element. My question is, what is this version used for?


laurent.orseau
2021-3-26 10:48:41

~I think it’s for the version-exception field when you submit a package on http://pkgs.racket-lang.org\|pkgs.racket-lang.org~


yanyingwang1
2021-3-26 10:57:21

@laurent.orseau Oh, you mean this version is only used for specify the racket version? en…that could make sense… but the doc doesn’t seem to specifically say this.


yanyingwang1
2021-3-26 11:00:13

the doc says this:


laurent.orseau
2021-3-26 11:04:03

~Sorry, I misremembered the field name (I should have checked). I was thinking of the Add new version field when creating a package on the server. So basically when you create a package A, you can add a specific version of this package, say A1, by specifying a version name x.y.z , say 1.2.0 along with a particular tag/commit. Now when you make another package B that depends on A and you want the stable version A1 fo A, you can use the #:version "1.2.0" field in the info.rkt to target the particular version A1 of A. Again, I think.~ See Sam’s message below.


yanyingwang1
2021-3-26 11:27:19

@laurent.orseau and where or how can we define this version 1.2.0 It’s not a git tag, right?


laurent.orseau
2021-3-26 11:28:03

~When you create/edit a package on http://pkgs.racket-lang.org\|pkgs.racket-lang.org, at the bottom left there’s a green button Add new version~


yanyingwang1
2021-3-26 11:30:10

Oh. You are saying this. Actually this is my another question, I remember I’ve tried to do this before, but somehow when I click the submit button, it returns wrong without saying more detail reason.


yanyingwang1
2021-3-26 11:31:02

I’ll try this later after I got home and post the screen shot here


laurent.orseau
2021-3-26 11:47:24

Makes me think, regarding stable package, for-real(TM): Say you have a package A that depends on B and C (all of these on github), plus the main distribution.

The following could be automated: • Fetch the current commit number of A, B, and C, giving versions A1, B1, C1, say. • Create a new catalog with A1, B1, and C1, at these particular commits • Create a new package which only purpose is to ‘install’ the new catalog, and then installs A1 with the correct dependencies, with fallback to the main catalog for the main distribution and other unversioned packages • (manual) Upload this package on pkgs. Ideas for refinements?


soegaard2
2021-3-26 11:50:06

@laurent.orseau A piece of the puzzle? https://github.com/Bogdanp/racksnaps


alexharsanyi
2021-3-26 12:01:39

I do this for ActivityLog2


alexharsanyi
2021-3-26 12:03:02

laurent.orseau
2021-3-26 12:50:39

Racksnaps is great (I’d probably say awesome if I’d used it), but it’s pretty heavy weight. What I propose is much lighter.


laurent.orseau
2021-3-26 13:03:43

I saw that post but I wasn’t ready to understand it :slightly_smiling_face: I still need to look into git submodules to get a better grasp of the implications.

Regarding the main drawback about global packages with global names, there may be a workaround: • when installing A with a commit 12ab34ef, name the collection A–12ab34ef. • Generate a deps.rkt file, specific to the project, and overrides require so that it checks for A/file1 and replaces it with A-12ab34ef/file1 I haven’t tried overriding require yet, but that seems feasible.


laurent.orseau
2021-3-26 13:09:15

The fact that the project is cloned rather than linked is not ideal though. It can make the package significantly larger


laurent.orseau
2021-3-26 13:10:32

and is more likely to lead to discrepancies between the local version and the upstream one. Although the fact that you can fix bugs if the upstream maintainer is unresponsive is a certain advantage.


laurent.orseau
2021-3-26 13:18:29

Or, rather, using make-require-transformer to provide a versioned require transformer whose meaning is specific to the current package


samth
2021-3-26 13:18:41

No, what @laurent.orseau said is not correct


samth
2021-3-26 13:19:04

You can specify a version for a package in the info.rkt file.


samth
2021-3-26 13:19:38

Then if another package needs that version of your package, they can use the #:version specification


massung
2021-3-26 13:19:56

Okay, what’s today for the turtle logo? Is it the birthday of Logo/Turtle graphics?


samth
2021-3-26 13:20:15

And the package system will ensure that when installing the other package, they get a sufficiently new version of your package


spdegabrielle
2021-3-26 13:20:19

Honu!


samth
2021-3-26 13:21:05

I don’t see how using racksnaps is heavyweight


alexharsanyi
2021-3-26 13:21:35

Well, the main aim of my proposed method is to put the application author in control over the versions of the modules used by the application, so of course there will be discrepancies — this is the purpose of it. Also, you can always run a “git submodule foreach git pull” to update to the latest packages in one go, or to update individual packages as needed.



laurent.orseau
2021-3-26 13:22:38

Racksnap itself is heavy weight, and won’t scale up if suddenly the community gets bigger and the number of packages explodes. Not my problem though :smile: It’s just that I find the code duplication not very DRY


laurent.orseau
2021-3-26 13:23:18

Then I’m confused. What’s the use of “Add new version” then?


samth
2021-3-26 13:23:19

What code is duplicated?


alexharsanyi
2021-3-26 13:23:22

with regards to the “global” scope, I have a few ideas on how to solve it, but so far it did not create major problems for me. After all, so far, everyone who runs “raco pkg install” will get their packages in a global scope and these packages will be available to all Racket applications for that user.


samth
2021-3-26 13:23:30

That’s for version exceptions


alexharsanyi
2021-3-26 13:24:08

… things might be different with xiden, but I didn’t look into too much detail on that.


laurent.orseau
2021-3-26 13:24:27

I think Racksnap keeps multiple full snapshots of all packages, no?


samth
2021-3-26 13:25:12

There’s some redundant storage, I agree — I just wouldn’t call that code duplication


laurent.orseau
2021-3-26 13:26:25

Oh wow, that’s very unclear! Could we have at least a <https://docs.racket-lang.org/pkg/getting-started.html#%28part..Version.Exceptions%29|link to the docs> next to the button?


samth
2021-3-26 13:26:25

And I think that if the number of packages grew a lot, then eliminating redundant storage would be worthwhile but not that hard


samth
2021-3-26 13:26:49

Today is Prince Kuhio Day


laurent.orseau
2021-3-26 13:27:43

It’s just the philosophy of redundancy that doesn’t click for me


popa.bogdanp
2021-3-26 13:28:37

Packages in Racksnaps use a content-addressing scheme for de-duplication so most packages don’t actually change on disk between daily snapshots, unless their contents (or the version of Racket used to build them) have changed.


massung
2021-3-26 13:29:04

ah ok


spdegabrielle
2021-3-26 13:29:59

Macros without parentheses! IIRC




samth
2021-3-26 13:32:14

That’s named for Honu (the Hawaiian word for turtle). Robby’s family is from Hawai’i which is where the Honu thing comes from.


robby
2021-3-26 13:32:29

green sea turtle :slightly_smiling_face:


laurent.orseau
2021-3-26 13:34:17

I know, and that’s pretty cool, and I find Racksnap remarkable still :slightly_smiling_face: I just feel we should be able to do better.


samth
2021-3-26 13:35:02

Storing all the packages seems pretty fundamental to the problem


laurent.orseau
2021-3-26 13:35:02

@samth I’m struggling to find the docs about how to use the version field in info.rkt


laurent.orseau
2021-3-26 13:36:04

In principle you only need the repository url and the commit/date you’re looking for.


samth
2021-3-26 13:37:57

That assumes that the repository stays available and keeps its history with the same hashes though


spdegabrielle
2021-3-26 13:38:24

laurent.orseau
2021-3-26 13:39:26

yes



laurent.orseau
2021-3-26 13:39:57

But the pkgd server also assumes this already


samth
2021-3-26 13:41:58

No, it doesn’t, it just assumes that the current entry for the package is available


laurent.orseau
2021-3-26 13:42:39

Thanks! I always struggle to find this page :confused: > A _version-string_ specifies a lower bound on an acceptable https://docs.racket-lang.org/pkg/Package_Concepts.html#%28tech._version%29\|version of the needed package. Ha, so this assumes the package remains backward-compatible (which I’m not ready to assume, apart from the main distribution)


samth
2021-3-26 13:42:43

For example, I can change the repository I use, or force-push, and break things if you just kept the old info


laurent.orseau
2021-3-26 13:43:15

There’s a commit field, so it does assume this I guess


samth
2021-3-26 13:43:18

Right, that’s a fundamental assumption and discussed in the docs


samth
2021-3-26 13:43:52

You can specify a commit if you want, in which case that particular commit has to remain in order for the package to work


yanyingwang1
2021-3-26 13:58:20

@samth so it means, if I have a package named A and its info.rkt has defined version to 0.1, and then I create another package named B and its info.rkt has a deps list includes an element of A with version 0.1. At this time, if I run raco pkg install for package B, it will automatically install package A with version 0.1, is this correct?


samth
2021-3-26 13:59:07

Package A with version at least 0.1, so that if package A releases version 0.2, you’ll get that


yanyingwang1
2021-3-26 14:05:07

Oh, I see. So this means the http://pkg.racket-lang.org\|pkg.racket-lang.org website must have recorded the status of every package’s info.rkt after its each updating.


samth
2021-3-26 14:05:56

Yes, that’s right


yanyingwang1
2021-3-26 14:27:57

And I just realized that, previously, as my reading the chapter of the package management doc https://docs.racket-lang.org/pkg/metadata.html\|https://docs.racket-lang.org/pkg/metadata.html, I incorrectly have the feeling and impression that the version defined in the info.rkt is only used for some kind of announcement, that probably because of this line of doc: A version is intended to reflect available features of a package, and should not be confused with different releases of a package as indicated by the checksum. But actually the version in the info.rkt is pretty useful. How do you guys think if we improve this and add an explaination that http://pkg.racket-lang.org\|pkg.racket-lang.org will record the updating of info.rkt to make it more understandable?


jesse697
2021-3-26 15:56:54

Racketfest 2021 is just a few hours away! About 70 people signed up.


jesse697
2021-3-26 16:02:03

the Gather space is open, but our capacity reservation only kicks in at 19:30 CET (2.5 hours from now), so the performance might be suboptimal till then


laurent.orseau
2021-3-26 16:36:21

Will you record the discussions as well?


jesse697
2021-3-26 16:54:25

those won’t be recorded, I’m afraid


jesse697
2021-3-26 16:55:26

if someone were to just hang out in the auditorium and screen grab the whole event, that would suffice!


spdegabrielle
2021-3-26 17:05:02

Live blog!


soegaard2
2021-3-26 17:05:59

I think, not recording is a good thing. It makes an incentive to participate in the event.


jesse697
2021-3-26 17:08:17

+1


jesse697
2021-3-26 17:08:37

maybe gitter?


jesse697
2021-3-26 17:09:33

OTOH, the Q&A will be by video (though there will be a text-based fallback not unlike what was done at RacketCon),


yoeskastyle
2021-3-27 03:32:42

@yoeskastyle has joined the channel