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.
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.
Do you want the user to be able to “scroll back and see older input lines” — or not be able to do that?
What curses-like functionality do you need — just moving cursor and writing over stuff there?
Yeah, I just want to be able to do a simple addressable cell based UI like curses.
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.
There might be some package I don’t know about; maybe someone else can help later.
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.
I’ll just have to try and do something simple with racket/gui. Thanks anyway.
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:
:grin: Always nice when someone else does the work. But I’ll just have to buckle down and do something myself. Cheers.
Hi there is the https://docs.racket-lang.org/charterm/index.html?q=curses module
but I suppose that’s shell based
Yeah, I looked at that but charterm doesn’t support Windows as far as I can see. Thanks anyway.
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
i think i screwed up the initial installation, but at this point it’s not clear how to fix things.
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?
IOW the hash-table is the database of installed packages, and that is the entry for the bad package.
I think.
Maybe back up the file first. :slightly_smiling_face:
@jjwiseman ^
Oh if it’s installation-wide pkg it might be in /Applications/Racket/share/pkgs/pkgs.rktd
instead?
ah ok, i was just typing out how ~/Library/Racket/7.0
doesn’t have a pkgs
subdir, so let me check that.
When I typed /Applications/Racket/share/pkgs/pkgs.rktd
the Racket
part is probably something like Racket 7.0
. wherever you installed it.
nope. I have /Applications/Racket 7.1
, and its pkgs.rktd has no reference to the package in question
Oh.
Welp.
this all started when i tried reorganizing my project to work with your Makefiles, @greg! :slightly_smiling_face:
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.
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
)
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.
At least if it happens again, now you know how to get out of it, again. :grin:
(i also had to edit out a reference in links.rktd
)
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.
thanks for the help
oh, there we go. it was this in Tony Garnock-Jones’ old makefile: link:
raco pkg install --link -n $(PACKAGENAME) $$(pwd)
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?
@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.
so mine has:
(define collection "benchmark-ips")
I really wish local doco had links to global doco
if i understand correctly, it does seem that in some cases, you could define the package name in info.rkt
then
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.
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
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)
@jjwiseman that needs to be 'multi
because otherwise the collection would be hamt
ok, that’s what i thought, just wanted to make sure.
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)
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 && raco pkg install)
it still feels weird that the name of the package is not in the package metadata though!
I think that would probably be better and could be added (although of course not made mandatory)
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.