mark.warren
2019-2-1 13:45:13

Hi, this question feels a little garbled, so apologies in advance. Doe anyone know of a simple GUI for racket that looks like a terminal with curses type functionality, BUT that isn’t a terminal as I need it to work on Windows and MAC.


greg
2019-2-1 15:27:54

I don’t have any real hands-on time with racket/gui, so I’m not sure if you can use a text% to do this.


greg
2019-2-1 15:28:14

Do you want the user to be able to “scroll back and see older input lines” — or not be able to do that?


greg
2019-2-1 15:28:48

What curses-like functionality do you need — just moving cursor and writing over stuff there?


mark.warren
2019-2-1 15:30:21

Yeah, I just want to be able to do a simple addressable cell based UI like curses.


mark.warren
2019-2-1 15:31:18

I’ve been looking at the racket GUI stuff and it’s great, but maybe more than I want to deal with at the moment.


greg
2019-2-1 15:32:02

There might be some package I don’t know about; maybe someone else can help later.


mark.warren
2019-2-1 15:33:43

I’ve had a hunt around and most of the ones I’ve found only work on linux and maybe Mac, but Windows is a pain apparently.


mark.warren
2019-2-1 15:34:17

I’ll just have to try and do something simple with racket/gui. Thanks anyway.


greg
2019-2-1 15:37:24

If you want a fixed cols x rows thing, like 80x25, I imagine the hardest part will be figuring out the char <-> pixel math (for sizing the frame, and for drawing) given some font. I think responding to “paint” or “draw” messages, and updating the screen dc from some vector of chars, is the easier part? But idk. And yes, it seems like a nice thing for someone else to have written, already. :slightly_smiling_face:


mark.warren
2019-2-1 15:39:11

:grin: Always nice when someone else does the work. But I’ll just have to buckle down and do something myself. Cheers.


d_run
2019-2-1 15:58:36

d_run
2019-2-1 15:59:07

but I suppose that’s shell based


mark.warren
2019-2-1 16:00:05

Yeah, I looked at that but charterm doesn’t support Windows as far as I can see. Thanks anyway.


jjwiseman
2019-2-1 17:51:51

i’m having a problem removing an installed package: $ raco pkg show Installation-wide: Package Checksum Source /Users/wisej041/Dropbox/Client/src/aici/deliberator/aici link /Users/wisej041/Dropbox/Client/src/aici/deliberator/aici/ [...] $ raco pkg remove /Users/wisej041/Dropbox/Client/src/aici/deliberator/aici raco pkg remove: package name includes disallowed characters given: /Users/wisej041/Dropbox/Client/src/aici/deliberator/aici $ raco pkg remove aici Removing aici raco pkg remove: package not currently installed package: aici current scope: installation


jjwiseman
2019-2-1 17:54:54

i think i screwed up the initial installation, but at this point it’s not clear how to fix things.


greg
2019-2-1 18:07:30

You might be able to edit /Users/wisej041/Library/Racket/7.0/pkgs/pkgs.rktd — changing 7.0 to whatever version of Racket. pkgs.rktd is just a Racket hash-table literal expression. There is probably a ("/Users/wisej041/Dropbox/Client/src/aici/deliberator/aici" . __other__stuff__) s-expression you could delete?


greg
2019-2-1 18:08:11

IOW the hash-table is the database of installed packages, and that is the entry for the bad package.


greg
2019-2-1 18:08:13

I think.


greg
2019-2-1 18:08:21

Maybe back up the file first. :slightly_smiling_face:


greg
2019-2-1 18:08:56

@jjwiseman ^


greg
2019-2-1 18:14:28

Oh if it’s installation-wide pkg it might be in /Applications/Racket/share/pkgs/pkgs.rktd instead?


jjwiseman
2019-2-1 18:14:56

ah ok, i was just typing out how ~/Library/Racket/7.0 doesn’t have a pkgs subdir, so let me check that.


greg
2019-2-1 18:16:24

When I typed /Applications/Racket/share/pkgs/pkgs.rktd the Racket part is probably something like Racket 7.0. wherever you installed it.


jjwiseman
2019-2-1 18:16:25

nope. I have /Applications/Racket 7.1, and its pkgs.rktd has no reference to the package in question


greg
2019-2-1 18:16:32

Oh.


greg
2019-2-1 18:16:34

Welp.


jjwiseman
2019-2-1 18:17:31

this all started when i tried reorganizing my project to work with your Makefiles, @greg! :slightly_smiling_face:


greg
2019-2-1 18:17:53

I guess you could Spotlight search for pkgs.rktd files, or even for that that "/Users/wisej041/Dropbox/Client/src/aici/deliberator/aici" string. It’s got to be somewhere — I’m pretty sure it’s in a plain text file not something like a sqlite db file.


jjwiseman
2019-2-1 18:19:19

ah, yes, thanks: /usr/local/Cellar/minimal-racket/7.0/share/racket/pkgs/pkgs.rktd (should have mentioned i was using minimal-racket via brew)


greg
2019-2-1 18:20:18

Cool. If you start by running raco pkg install in /path/to/dir, it should create a local package named dir? I wonder how you got into that before.


greg
2019-2-1 18:20:51

At least if it happens again, now you know how to get out of it, again. :grin:


jjwiseman
2019-2-1 18:22:36

(i also had to edit out a reference in links.rktd)


jjwiseman
2019-2-1 18:24:12

i don’t even think i was doing anything too weird, though i no longer remember exactly what commands i might have run to get it into this state.


jjwiseman
2019-2-1 18:24:25

thanks for the help


jjwiseman
2019-2-1 18:27:07

oh, there we go. it was this in Tony Garnock-Jones’ old makefile: link: raco pkg install --link -n $(PACKAGENAME) $$(pwd)


jjwiseman
2019-2-1 20:57:51

i find it a little odd that package names are typically implicit, not explicit. that is, i had an expectation that info.rkt, which defines many important things about a package, would also define the package’s name. but instead, the name is derived either from the name of the directory the project happens to be in (typically a top-level directory in a source control repository, which can lead to conflicts between repository namespaces and racket project namespaces, and can also be renamed by the cloner for various reasons) or it’s specified in an argument to raco pkg install somewhere outside of info.rkt. is this a little weird/out of step with the usual practices for other languages, or is there something i’m missing?


zenspider
2019-2-1 21:09:15

@jjwiseman I think that’s not entirely true? I don’t have the most experience but my package defines collection which can either be 'multi, 'use-pkg-name, or a string, which is the collection name.


zenspider
2019-2-1 21:09:31

so mine has:

(define collection "benchmark-ips")

zenspider
2019-2-1 21:10:14

I really wish local doco had links to global doco


zenspider
2019-2-1 21:10:25

jjwiseman
2019-2-1 21:18:20

if i understand correctly, it does seem that in some cases, you could define the package name in info.rkt then


jjwiseman
2019-2-1 21:20:27

but only in the single-collection package case? it feels like i almost always see collection defined as 'multi even if it’s not a multi-collection package, and i’m not sure why that is.


zenspider
2019-2-1 21:21:01

There’s been a trend of late to break pkg into pkg-test and pkg-doc, so that might be why the numbers look skewed


jjwiseman
2019-2-1 21:22:06

Looking at https://github.com/97jaz/hamt as an example—just so i’m clear, that has to have collection defined as 'multi, correct? (it’s the source of the hamt package in the data collection, which collection also contains other packages whose source lives elsewhere)


samth
2019-2-1 21:23:50

@jjwiseman that needs to be 'multi because otherwise the collection would be hamt


jjwiseman
2019-2-1 21:24:09

ok, that’s what i thought, just wanted to make sure.


jjwiseman
2019-2-1 21:25:00

and in that case there’s nowhere to be explicit about the name of the package itself? (unless you consider the name of the repository to be that explicit statement)


jjwiseman
2019-2-1 21:26:20

i suppose you could push everything down a directory. have the hamt repo contain a hamt subdir that contains info.rkt and data/, and then you have to (cd hamt &amp;&amp; raco pkg install)


jjwiseman
2019-2-1 21:30:02

it still feels weird that the name of the package is not in the package metadata though!


samth
2019-2-1 21:31:12

I think that would probably be better and could be added (although of course not made mandatory)


greg
2019-2-1 22:36:03

Also IIRC originally there were only multi-collection packages. Single-collection added later. So you will see pkgs that date from back then, which are multi-collection, even if they only provide a single one. e.g. Most of my own are like that. In theory I could change them to single, but if isn’t broken…. TL;DR You may see example packages that are more complicated in that regard, than you need to from scratch, today.