Re: [racket-users] Struct declaration conflict if a file is required implicitly

2017-07-23 Thread hiphish
On Sunday, July 23, 2017 at 5:43:51 PM UTC+2, Ryan Culpepper wrote: > On 07/23/2017 07:26 AM, Alejandro Sanchez wrote: > > Hello everyone, > > > > I am working on this project: https://gitlab.com/HiPhish/MsgPack.rkt/ > > > > I am writing test cases and

[racket-users] Re: [ANN] MessagePack implementation for Racke

2017-07-26 Thread HiPhish
On Tuesday, July 25, 2017 at 11:37:48 PM UTC+2, Lehi Toskin wrote: > One thing I'm curious about is what things can you and can you not pack? In > the README it shows bytes being packed, which seems a little obvious, but > what about (transparent) structs? Hashes? Lists? I'm very interested in

[racket-users] Re: Need help porting a library to Typed Racket

2017-08-07 Thread hiphish
Thank you for your response. Right now I cannot implement it because either Racket or my package manager (or both) keeps breaking itself, but I will keep in mind what you said. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe

[racket-users] Racket from Homebrew has trouble when upgrading

2017-08-07 Thread hiphish
Hello, I have had this same problem when I was upgrading Racket from 6.8 to 6.9, and now again when upgrading from 6.9 to 6.10. Basically what happens is that raco downloads and installs all packages as if they were for the previous version of Racket. I installed Racket as 'brew install

[racket-users] Re: Racket from Homebrew has trouble when upgrading

2017-08-07 Thread hiphish
It seems I got it working now. I deleted `(find-system-path 'config-dir)` and `(find-system-path 'addon-dir)`. My bet is that the former was the culprit. We'll see about that when 6.11 is released. -- You received this message because you are subscribed to the Google Groups "Racket Users"

[racket-users] Re: Need help porting a library to Typed Racket

2017-08-06 Thread hiphish
*bump* I hope bumping is not frowned upon here. I just need to sort this one last issue out -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[racket-users] Requiring module beneath top level?

2017-08-18 Thread hiphish
Hello Racketeers, A while ago I announced my MessagePack library here and I mentioned that I was needing it for a client library for the Neovim text editor. Since then I have been writing this client library and now I'm at a point where I need help. Let me first give you some context: Neovim is

Re: [racket-users] Requiring module beneath top level?

2017-08-22 Thread hiphish
> On Fri, Aug 18, 2017 at 7:08 PM, wrote: > I think you want `dynamic-require`: > [http://docs.racket-lang.org/reference/Module_Names_and_Loading.html?q=dynamic-require#%28def._%28%28quote._~23~25kernel%29._dynamic-require%29%29] Thank you, that's what I needed. I'll

[racket-users] Generate function defintions at compile time

2017-08-22 Thread hiphish
Hello, I am writing a Racket library which will make it possible to control the Neovim text editor using Racket. People will be able to use Racket to control Neovim, as well as write plugins for Neovim in Racket. https://gitlab.com/HiPhish/neovim.rkt So far it looks good, but I am stuck

Re: [racket-users] Need help improving a macro

2017-08-30 Thread hiphish
> I would love to see some library provide better abstractions for > fairly common cases of keywords like this Honestly, I don't think I need a library, I need better knowledge. Your macro works, but I have no idea how I could have come up with it. The Racket guide gives a good introduction to the

[racket-users] Neovim Racket host: control Neovim using Racket

2017-09-11 Thread hiphish
Hello Racketeers, I wrote a new package, an API client for the Neovim text editor: https://gitlab.com/HiPhish/neovim.rkt https://pkgs.racket-lang.org/package/nvim-client With this it is possible to control Neovim with Racket. In particular, it is now possible to write Neovim plugins in Racket

Re: [racket-users] Neovim Racket host: control Neovim using Racket

2017-09-12 Thread hiphish
> These two problems are related AFAICT. Currently your package is set up > as a multicollection package but the info.rkt file is only in the top-level > directory, whereas it should go in the subdirectories. I suspect you don't > actually want a multicollection package in this case. Yes, you're

Re: [racket-users] Generate function defintions at compile time

2017-08-23 Thread hiphish
Thank you all for your answers, I think I got it right this time, but I would still appreciate feedback: https://gitlab.com/HiPhish/neovim.rkt/blob/master/nvim/api.rkt I think what was confusing me was that I was thinking of Racket macros like Common Lisp macros. Instead of trying to build a list

[racket-users] Need help improving a macro

2017-08-29 Thread hiphish
Hello, I have a working macro written using `syntax-parse`, but it still has some kinks that need to be worked out. What I want the macro to do is define a function and as it as input to another function. Example: (define-nvim-function (foo bar baz) #:name "foo" #:sync #f (display bar)

[racket-users] Re: Alternatives to DrRacket

2017-11-26 Thread HiPhish
I use Neovim and I'm working on a Racket client for it: https://gitlab.com/HiPhish/neovim.rkt One of the cool features Neovim has over Vim is that it provides an API for remote processes; a client application can connect to the editor and they can communicate with each other. What that means

[racket-users] Typed Racket has lowered my performance

2017-12-02 Thread HiPhish
types (vectors and hashes) time out on the package server, and thus fail. https://gitlab.com/HiPhish/MsgPack.rkt/commit/0b6cdc7115389db97a8de2a5175c1feb4c939f8f Please let me provide some context first: MessagePack is a serialisation format similar to JSON, except binary, so it should be smaller

[racket-users] Re: Raising arbitrary errors in Typed Racket

2017-12-02 Thread HiPhish
Thank you everyone, I have gotten it up and running now. I'll make a formal announcement once I get an unrelated performance issue sorted out. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving

Re: [racket-users] Raising arbitrary errors in Typed Racket

2017-12-02 Thread HiPhish
What is any-wrap/c? It does not show up in the documentation. On Friday, December 1, 2017 at 9:17:18 PM UTC+1, Robby Findler wrote: > > Why not use any-wrap/c? > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group

Re: [racket-users] Raising arbitrary errors in Typed Racket

2017-12-01 Thread HiPhish
Thank you, I have made my own exception type now. Is `exn:fail:rpc` appropriate or should I use a different name? Using that name looks like I'm inserting it into Racket's own exception type hierarchy. On Friday, December 1, 2017 at 8:11:27 PM UTC+1, Ben Greenman wrote: > > ... > -- You

[racket-users] Re: using vim to play with racket

2017-12-20 Thread HiPhish
language, but in Neovim that support can be retrofitted to the editor as an external process. So for example, if you want to write Neovim plugins in Python you install the Python client via pip. And if you want to write plugins in Racket you install my Racket client: https://gitlab.com/HiPhish

[racket-users] Raising arbitrary errors in Typed Racket

2017-12-01 Thread HiPhish
Hello Racketeers, I have been trying to port a module over to Typed Racket, and I have almost succeeded except for one issue: raising an arbitrary object as an error. Compare the following code: ;; Works fine (raise 3) ;; Does not work (raise (vector 1 2 3)) The error I get is

Re: [racket-users] Typed Racket has lowered my performance

2017-12-02 Thread HiPhish
> The performance is probably because HashTable and Vector values can be > mutable, so Typed Racket needs to do extra work to protect them. > > To test this, I cloned msgpack, removed `Vector` from the `Packable` > type, and changed `HashTable` to `Immutable-Hashtable`. Change here: >

Re: [racket-users] Re: Typed Racket has lowered my performance

2017-12-03 Thread HiPhish
Anything more I can do? On Sunday, December 3, 2017 at 6:11:42 PM UTC+1, Sam Tobin-Hochstadt wrote: > > Thanks, that's very helpful. It's clear that the contract optimization is > working in the old code but not the new code, and we need to fix that. > -- You received this message because you

[racket-users] Re: Typed Racket has lowered my performance

2017-12-02 Thread HiPhish
Now that I think about it, changing the types to be immutable is not really correct either. There is no reason users should not be able to serialise a mutable list, vector or hash table, just as they can serialise any mutable scalar as well. The result of unpacking bytes could be immutable, but

Re: [racket-users] Re: Typed Racket has lowered my performance

2017-12-04 Thread HiPhish
When I change the return type of `unpack` to `Packable` instead of an explicit union of types the map packing test (`test/pack/map.rkt`) hangs. https://gitlab.com/HiPhish/MsgPack.rkt/blob/master/unpack.rkt#L83 https://gitlab.com/HiPhish/MsgPack.rkt/blob/master/test/pack/map.rkt -- You received

Re: [racket-users] Re: Typed Racket has lowered my performance

2017-12-08 Thread HiPhish
No, I did the same thing, and only the first hundred tests work normally, the other 100 hand for several minutes. Maybe my computer is too weak, it's an early 2009 iMac with a 2.66GHz Core2Duo and 8GB of RAM. I also ran `raco setup msgpack` after making the change to the source file to make

Re: [racket-users] Re: Typed Racket has lowered my performance

2017-12-03 Thread HiPhish
Is there anything I can do to help investigate the issue? I have reverted my commit for the time being, and it's a difference like day and night. On Sunday, December 3, 2017 at 12:36:16 AM UTC+1, Sam Tobin-Hochstadt wrote: > > I don't think the mutable/immutable issue should be as significant as

Re: [racket-users] Re: Typed Racket has lowered my performance

2017-12-03 Thread HiPhish
Here is what happens when I run one of the array tests with the more restrictive type specifications: OK, passed 100 tests. Running time is 70.75% contracts 75/106 ms (-> (recursive-contract (or/c (and/c hash? (and/c hash-equal ... 75 ms (lib msgpack/pack.rkt):24:9

[racket-users] Re: github for third-party racket packages

2018-05-26 Thread HiPhish
with the Racket package management is no issue either. The web interface is aware of Git and works with any hosting service. I personally prefer to have the source code in a sub-directory of the project rather than in the root, and Racket supports this feature as well, like this: https://gitlab.com/HiPhish

Re: [racket-users] How to integrate Racket with a .Net application?

2018-02-02 Thread HiPhish
> and <255. I filed an issue at > https://gitlab.com/HiPhish/MsgPack.rkt/issues/4 > > Berthold > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it,

Re: [racket-users] How to integrate Racket with a .Net application?

2018-02-01 Thread HiPhish
On Wednesday, January 31, 2018 at 4:17:09 PM UTC+1, Greg Hendershott wrote: > > Another way is for two (OS) processes to "pipe" I/O to each other. > This is a great idea since it would allow to integrate any language with the .NET application. It is how Neovim does it: the main application is

[racket-users] Defining algebraic data types?

2018-02-04 Thread HiPhish
Hell Racketeers, I am trying to write an implementation of the mathematical concept of dual quaternions in Racket. Dual quaternions are an algebraic type and there are several equally valid way to look at them. Let me give some background first. A dual number (a + bε) is similar to a complex

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread HiPhish
Thank you for your answer, Sam. 1) does not really capture it, and 2) is a proof of concept that hasn't been updated in almost a year. But it did give me a good idea: use Typed Racket and have the type system work for me. (struct (N) D ([real : N] [dual : N])) (define-type (Dual-Number N)

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread HiPhish
Why would that be a problem? The caller has to provide a function for "adding" and "multiplying" an N, and as long as I define what it means to multiply and add strings it shouldn't matter that I'm using a dual number where both components are strings. But I think this is a case of the

Re: [racket-users] Defining algebraic data types?

2018-02-06 Thread HiPhish
That makes perfect sense, thank you. On Tuesday, February 6, 2018 at 12:43:07 AM UTC+1, Sam Tobin-Hochstadt wrote: > The problem is that the definition of `(Dual-Number N)` includes `N`, > and therefore > > (Dual-Number (Dual-Number String)) might either be a (D (D "x" "y") (D > "x" "y")) or

Re: [racket-users] Defining algebraic data types?

2018-02-05 Thread HiPhish
Did your email get cut off? On Monday, February 5, 2018 at 6:00:05 PM UTC+1, Sam Tobin-Hochstadt wrote: > > This is an unfortunately common pitfall -- if you instantiated N with > something that includes a dual number, then the type error would be > pointing to a real bug. If > > Sam > --

[racket-users] Re: Concise way to get completions for Racket code?

2018-02-09 Thread HiPhish
I'm afraid that's not possible. The functionality that gets the completion candidates is written in Racket: #lang racket/base (require nvim/rplugin framework) (define (complete prefix) (define completions (text:get-completions/manuals #f)) (filter (λ (x) (regexp-match

[racket-users] Re: Concise way to get completions for Racket code?

2018-02-09 Thread HiPhish
Thank you for finding that. I have used your snippet to add omni-completion to Neovim now. I need to file down some rough patches before I make it a plugin, but it works. Not as useful as having proper semantic completion would have been, it does not include identifiers from the current module

[racket-users] Re: Concise way to get completions for Racket code?

2018-02-13 Thread HiPhish
On Monday, February 12, 2018 at 9:02:20 AM UTC+1, Gour wrote: > > > I had tried tried several times with Emacs, but, for some strange reason, > very > soon I would experience some wrist pain and finally gave up on it. > > Otoh, it does never occur when using Vim...yes, I also have Neovim >

Re: [racket-users] Re: Concise way to get completions for Racket code?

2018-02-13 Thread HiPhish
Wow, this sounds like just the right thing. But the question is, how does one get the namespace of the current text buffer? I guess I would need to somehow send the buffer contents over to Racket and build a namespace out of that? On Tuesday, February 13, 2018 at 1:39:49 PM UTC+1, William G

Re: [racket-users] Re: Concise way to get completions for Racket code?

2018-02-16 Thread HiPhish
Thank you for the offer, but I am currently tied up myself a lot. I was just looking into this because the topic had popped up here. I should have provided some context as to how the Neovim Racket client works. When I'm experimenting I use the regular REPL from my terminal, not the client,

[racket-users] Re: using vim to play with racket

2017-12-20 Thread HiPhish
> Maybe it is because of the fact that my daily job requires me to do manual > compilation frequently but I don't find this very difficult. Yeah, I use a package manager and only compile manually when I absolutely have to because I don't like dealing with dependencies. A matter of perspective I

[racket-users] Re: RacketCon 2018 Website

2018-04-20 Thread HiPhish
Yeah, those fancy things are an accessibility nightmare. When I zoom in in FireFox the line breaks are fine, but between 110% and 200% zoom factor the text actually gets smaller when zooming in, and beyond 200% it gets larger again. As for screen readers, I am no ARIA expert, but from what I

[racket-users] Sequences in Typed Racket?

2018-04-22 Thread HiPhish
Hello Racketeers, I have been playing around with the `math/number-theory` package and I wanted to use a `for`-loop of Fibonacci numbers. I had to write something like (for ([i (in-naturals)]) (define fib (fibonacci i)) ...) So I thought it would be nice to have an

Re: [racket-users] Sequences in Typed Racket?

2018-04-23 Thread HiPhish
The adapter submodule does not work, I get the following error (in both typed and untyped Racket): fib.rkt:9:0: module: no #%module-begin binding in the module's language in: (module adapter racket/stream (provide stream-first stream-rest (rename-out (stream-cons* stream-cons)))

[racket-users] Re: Why is there a space in the path to the Racket application on MacOSX?

2018-03-29 Thread HiPhish
I think you are trying to solve the wrong problem. If people want to use a command-line tool they should know how to use the command line first. They don't have to know every arcane feature of the Bourne Shell, but knowing to escape spaces or quote strings is the bare minimum. Think about it

Re: [racket-users] Splitting up a GUI source file?

2018-03-24 Thread HiPhish
Thank you for the paper. I had come across units several times, but I could never figure out *what* their intention was from the documentation. The paper has at least made their motivation clear, I still have to figure out how to actually use this feature now. On Friday, March 23, 2018 at

[racket-users] Re: Why is there a space in the path to the Racket application on MacOSX?

2018-04-01 Thread HiPhish
, Stephen Smith wrote: > > 2. @HiPhish: "Users should learn the command-line first". Although I agree > with this in almost any other context, my book is for people who have never > programmed before. So they will be learning the command-line and GUI at the > same

Re: [racket-users] Re: Why is there a space in the path to the Racket application on MacOSX?

2018-03-30 Thread HiPhish
The benefit is that it looks nicer on the eyes in a GUI. I presume OP is talking about the Racket installation you get off the Racket website, and that installation is targeted at GUI users. I myself prefer the command-line and I use Racket via Homebrew, so I never even come across this issue.

[racket-users] Re: Why is there a space in the path to the Racket application on MacOSX?

2018-03-31 Thread HiPhish
BTW, on the topic of writing robust shell scripts, I always have a linter run over my scripts when I save them. I run Shellcheck automatically in Neovim using the Neomake plugin. The linter catches among other things missing quotations. https://www.shellcheck.net/

[racket-users] Re: The Racket School 2018: Create your own language

2018-03-19 Thread HiPhish
Will the content (video, PDFs, exercises and solutions) also be available online for those who cannot attend? The topic does sound very interesting, at the moment I only know how to use Racket like any other programming language, but I have no idea how to approach the language-oriented angle.

[racket-users] Splitting up a GUI source file?

2018-03-23 Thread HiPhish
Hello Racketeers, I am trying to create a GUI program, my problem is that the source code for the GUI portion is growing out of control and I don't know how to split it up. Here is some background info: the GUI is basically just a specialised frontend to a database, the users clicks some

[racket-users] Re: Getting young children started with Racket

2018-03-05 Thread HiPhish
I am not a father, so take everything with a grain of salt from me. Also, obvious disclaimer, every child is different, you know your children best, and all the usual stuff... With that out of the way, I think computer illiteracy is one of the big injustices that gets perpetrated in our modern