Re: [racket-users] Struct properties and recursion

2019-02-22 Thread Sam Tobin-Hochstadt
I think the issue is that there's genuinely a cycle here, and so you have to take advantage of mutation or the implicit mutation of module initialization. point-x has a reference to the point structure type, which in turn has a reference to the table of properties, which contains the writer

[racket-users] Struct properties and recursion

2019-02-22 Thread Jack Firth
Does it seem weird to anybody else that there's no way to set struct properties without mutual recursion? Say I'm defining a 2d point struct and want to set the prop:custom-write property to control how points print. I might start with this: (struct point (x y) #:property prop:custom-write

Re: [racket-users] performance, json

2019-02-22 Thread WarGrey Gyoudmon Ju
I have tried my best to find the "best practice" to do Racket IO. Here are some tips I found in writing CSV reader: https://github.com/wargrey/schema/blob/master/digitama/exchange/csv/reader/port.rkt With a MacBook Pro 15, 2013, it takes 3.5s to read a 70MB file. I agreed that `read-char` is the

Re: [racket-users] Use cases for tables and records

2019-02-22 Thread Philip McGrath
On Fri, Feb 22, 2019 at 8:14 AM Matt Jadud wrote: > However, I'm happy to push to Github as well as Bitbucket (which > apparently does not play well with the package distribution system?), so > that it can be poked at by others. > On Fri, Feb 22, 2019 at 8:47 AM Sam Tobin-Hochstadt wrote: >

Re: [racket-users] performance, json

2019-02-22 Thread Jon Zeppieri
On a related (but not too related) note: is there an efficient way to skip multiple bytes in an input stream? It looks like there are two choices: - You can read the bytes you want to skip, but that implies either allocating a useless byte array or keeping one around for this very purpose. -

Re: [racket-users] Re: How do I get (system-tzid) to return the correct value?

2019-02-22 Thread Jon Zeppieri
On Fri, Feb 22, 2019 at 11:36 AM Brian Adkins wrote: > > It seems that not short circuiting would be a good idea regardless of > other changes. It's not urgent for me, because the code in question won't > run late in the evening where the problem occurs. > > I have a proposed fix, if you care

Re: [racket-users] performance, json

2019-02-22 Thread Matthew Flatt
I think the bigger bottleneck is the main parsing loop, which uses `regexp-try-match` even more. Although `regexp-try-match` is convenient, it's much slower than using `peek-char` directly to check for one character. I'll experiment with improvements there. At 22 Feb 2019 13:36:20 -0500, "'John

Re: [racket-users] big-step-stepper ==> tree-er?

2019-02-22 Thread Sorawee Porncharoenwase
I think Shriram and Preston have/had a plan similar to this. The top level shows a function call tree, and users can focus on a node which will show the usual stepper in that function. On Fri, Feb 22, 2019, 11:18 AM 'John Clements' via Racket Users < racket-users@googlegroups.com> wrote: > Has

[racket-users] big-step-stepper ==> tree-er?

2019-02-22 Thread 'John Clements' via Racket Users
Has anyone explored the idea of a “big-step stepper”? It wouldn’t be a “stepper” at all, of course, just a big tree, but you could imagine a learning tool that allows you to explore the evaluation of a term by unfolding parts of its big-step tree. Generating the raw data for this tree would be

Re: [racket-users] performance, json

2019-02-22 Thread Greg Trzeciak
There is http://docs.racket-lang.org/tjson/index.html available (haven't checked how similar the code is though) On Friday, February 22, 2019 at 7:36:23 PM UTC+1, johnbclements wrote: > > > > … and my guess is that the JS performance would be similar, if the json > reader in JS was written in

Re: [racket-users] performance, json

2019-02-22 Thread 'John Clements' via Racket Users
I’m not that surprised :). My guess is that our json reader could be sped up quite a bit. This looks like the heart of the read-json implementation: (define (read-json* who i jsnull) ;; Follows the specification (eg, at json.org) -- no extensions. ;; (define (err fmt . args)

Re: [racket-users] Strip the lexical context from an identifier

2019-02-22 Thread Matthias Felleisen
And that’s better of course because you pick up the lexical scope, which (let ([x 4]) [(my-macro x) 1 2]) shows. > On Feb 22, 2019, at 1:26 PM, Sam Caldwell wrote: > > You can also do this with syntax-local-introduce to remove x's use-site > scope*: > > #lang racket > > (require

Re: [racket-users] Strip the lexical context from an identifier

2019-02-22 Thread Sam Caldwell
You can also do this with syntax-local-introduce to remove x's use-site scope*: #lang racket (require (for-syntax syntax/parse)) (define-syntax (my-macro stx) (syntax-parse stx [(_ x:id) #:with x- (syntax-local-introduce #'x) #'(lambda (a b) x-)])) ((my-macro a) 1 2) ;; 1

Re: [racket-users] Strip the lexical context from an identifier

2019-02-22 Thread Matthias Felleisen
> On Feb 22, 2019, at 1:08 PM, Stefano Lande wrote: > > Dear all, > > first of all, I might being misusing the terminology. Sorry about it. > > I would like to write a macro that gets an identifier and return its value in > the new lexical scope created by the macro. > For example: > > >

[racket-users] Strip the lexical context from an identifier

2019-02-22 Thread Stefano Lande
Dear all, first of all, I might being misusing the terminology. Sorry about it. I would like to write a macro that gets an identifier and return its value in the new lexical scope created by the macro. For example: > (define-syntax (my-macro stx) (syntax-parse stx [(_ x:id) #'(lambda

Re: [racket-users] Re: Use cases for tables and records

2019-02-22 Thread James Platt
In R, I have extensively used the sqldf package, which allows you to execute SQL commands on one or more data frames and get the results back as another data frame. You can connect it to different database engines to handle the SQL. Although sqlite is the default, I mostly used PostgreSQL

[racket-users] performance, json

2019-02-22 Thread Brian Craft
I'm doing a few performance tests, just to get an idea of racket performance. The following result surprised me a bit. Parsing 1M strings from a json array, like (define samples (time (read-json (open-input-file "test.json" running with 'racket test.rkt' Comparing to js, java, and

Re: [racket-users] Re: How do I get (system-tzid) to return the correct value?

2019-02-22 Thread Brian Adkins
On Friday, February 22, 2019 at 11:23:10 AM UTC-5, Jon Zeppieri wrote: > > > On Fri, Feb 22, 2019 at 10:44 AM Brian Adkins > wrote: > >> >> Yes, I think we found the problem: >> >> $ ls -l /etc/localtime >> lrwxrwxrwx 1 root root 36 Feb 21 21:45 /etc/localtime -> >>

Re: [racket-users] Re: How do I get (system-tzid) to return the correct value?

2019-02-22 Thread Jon Zeppieri
On Fri, Feb 22, 2019 at 11:22 AM Jon Zeppieri wrote: > > - I could also abandon the symlink check altogether and always use the > slow path, which checks for file _content_ identity between /etc/timezone > and any file that names an IANA time zone in the zoneinfo tree. > Or. better, use

Re: [racket-users] Re: How do I get (system-tzid) to return the correct value?

2019-02-22 Thread Jon Zeppieri
On Fri, Feb 22, 2019 at 10:44 AM Brian Adkins wrote: > > Yes, I think we found the problem: > > $ ls -l /etc/localtime > lrwxrwxrwx 1 root root 36 Feb 21 21:45 /etc/localtime -> > /usr/share/zoneinfo/America/New_York > deploy@ip-172-31-10-34:~$ ls -l /usr/share/zoneinfo/America/New_York >

[racket-users] Re: Use cases for tables and records

2019-02-22 Thread Ryan Kramer
On the topic of tables, I recently thought "It would be nice if DrRacket had some awareness of tabular data, in the same way that picts and syntax objects get special treatment." For my project, I just wrote a quick-and-dirty function to make an ASCII art table and moved on:

Re: [racket-users] Use cases for tables and records

2019-02-22 Thread Greg Hendershott
The overall idea sounds great. I don't really understand the motivation for "records" with #:keywords? Maybe you could add a quick explanation about how/when/why they would be preferred over "more Rackety" choices: When the keys aren't known at compile time: - hasheq hash-tables with symbol

Re: [racket-users] Re: How do I get (system-tzid) to return the correct value?

2019-02-22 Thread Brian Adkins
On Thursday, February 21, 2019 at 11:16:00 PM UTC-5, Jon Zeppieri wrote: > > > > On Thu, Feb 21, 2019 at 10:12 PM Brian Adkins > wrote: > >> On Thursday, February 21, 2019 at 9:54:23 PM UTC-5, Jon Zeppieri wrote: >>> >>> >>> >>> On Thu, Feb 21, 2019 at 9:48 PM Brian Adkins wrote: >>> On

Re: [racket-users] Use cases for tables and records

2019-02-22 Thread travis . hinkelman
The data-science package isn't focused on the table (or data frame) structure (it uses lists of lists) but it includes tooling that is useful for working with data stored in that type of structure such as "split -> apply -> combine", column indexing, subsetting, grouping, and aggregating.

Re: [racket-users] Help with generators from python land!

2019-02-22 Thread Matthias Felleisen
> On Feb 21, 2019, at 10:32 PM, Konrad Hinsen > wrote: > > The main difference, as has been pointed out before, is that Python > generators are more common as an idiom for solving problems that in Racket > would typically be approached differently. [[ This is of course ironic in a way,

Re: [racket-users] Use cases for tables and records

2019-02-22 Thread Sam Tobin-Hochstadt
Bitbucket should work fine with the package system -- just provide the URL for the git repository as the source and everything should be good to go. Sam On Fri, Feb 22, 2019 at 8:14 AM Matt Jadud wrote: > > On Thu, Feb 21, 2019 at 2:59 PM wrote: >> >> >> - Tables, which are like a list of

Re: [racket-users] Use cases for tables and records

2019-02-22 Thread Matt Jadud
On Thu, Feb 21, 2019 at 2:59 PM wrote: > > - Tables , which are > like a list of records that all have the same keywords. Tables are similar > to dataframes and are intended to make it easy to process spreadsheet-like > data such as CSV files.

Re: [racket-users] "table" data structure in Racket

2019-02-22 Thread 'Paulo Matos' via Racket Users
On 22/02/2019 04:05, travis.hinkel...@gmail.com wrote: > After posing the question yesterday, I spent a little time poking around > in the Github repository for Apache Arrow and came to the same > conclusion, i.e., large project presumably facilitated by corporate backing. > True, they are