Giter Site home page Giter Site logo

racket-algebraic's People

Contributors

dedbox avatar winny- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

racket-algebraic's Issues

add parser options to macro forms

Already passing ... and ...+ through unaltered. What else?

  • parse options (e.g. #:literals #:disable-colon-notation)

That's it for now.

devise a performance analysis strategy

"Fast enough for me" is not a viable long term strategy. Eventually, I would like to automatically generate reports through raco whatever to help answer the following questions:

General Questions:

  • What aspects of Algebraic Racket are relevant to performance?
  • Which aspects are naturally fast or slow?

Ongoing Concerns:

  • How fast is Algebraic Racket right now?
  • What effect do the current changes have on performance?
  • Can it go any faster?

design the developer API

The next release brings three major updates:

  1. a completed tutorial series
  2. tighter integration with match and syntax-parse
  3. the initial developer API

Most of the work will be for number 3.

We need more information to make any sort of meaningful decision. What must it provide to be useful? Are there any examples that clearly demonstrates its utility? Does it have any unique or surprising qualities? What does any of this have to do with language-oriented programming?

add phi* and mu* constructors

For multi-arg, single-clause abstractions, so I can do something like this:

(define-syntax app (μ* (f x ...) (call-with-values (λ () (values x ...)) f)))

add #:as patterns

Like #:if patterns, but the target is a pattern instead of an expression.

Example:

(φ (Some v1) #:as v #:if (number? v1) (+ v 1))

fix expansion-time taints in macros

Doesn't work:

(define-syntax q-power
  (macro*
    [(0 _) 1]
    [(1 x) x]
    [(n:nat x) #'#,(macro-expand #`(* x (q-power #,(- (var n) 1) x)))]))
(q-power 3 2)

Gives this error:

/tmp/f.rkt:12:15: quote-syntax: cannot use identifier tainted by macro transformation
  in: quote-syntax
  location...:
   /tmp/f.rkt:12:15
  context...:
   raise-syntax-error
   binding-lookup50
   loop
   /usr/share/racket/collects/racket/private/template.rkt:199:4: parse-t-pair/command
   /usr/share/racket/collects/racket/private/template.rkt:330:4: parse-h
   /usr/share/racket/collects/racket/private/template.rkt:275:4: parse-t-pair/normal
   [repeats 3 more times]
   /usr/share/racket/collects/racket/private/template.rkt:177:2: parse-template
   /usr/share/racket/collects/racket/private/template.rkt:577:0: syntax
   apply-transformer-in-context
   apply-transformer52
   dispatch-transformer41
   do-local-expand50
   /usr/share/racket/collects/syntax/wrap-modbeg.rkt:46:4: do-wrapping-module-begin
   apply-transformer-in-context
   apply-transformer52
   ...

add regexp pattern bindings

Right now, regexps can only accept or reject a string:

((φ #rx"^(x+)$" 1) "xxxx")

It should also match an optional pattern list against the results:

f.rkt> ((φ (#rx"(x+)(y+)" xs ys) xs) "aaaaxxxxyyyybbbb")
"xxxx"

add exact matches for containers

Right now, #hash([x . 1]) matches a hash with at least the one binding. Instead, it should match a hash with only the one binding.

Inexact match should be denoted with a hanging wildcard, like it already is for instances or pairs:

(φ #hash([x . 1] . _) OK)

Other forms: struct, regexp, vector (?)

add more data patterns

Implement patterns for destructuring lists and other immutable data:

boolean, number, string, bytes, char, symbol, regexp, keyword, pair, list, vector, box, hash, void, struct

improve error message for undeclared quasiquoted constructors

This fails because the constructor S has not been declared yet.

base.rkt> ((φ `(x y . ,S) z) '(x y . S))
; stdin::7109: quasiquote: bad syntax
;   in: quasiquote
; Context:
;  /usr/share/racket/collects/racket/syntax.rkt:195:0 syntax-local-eval24
;  /usr/share/racket/collects/syntax/parse/private/parse.rkt:158:7 parse-con-id34
;  /usr/share/racket/collects/syntax/parse/define.rkt:13:9 φ

add prefab struct patt

Matching on #s literals fails because the prefab struct key is inside a custom reader. Here's how far I got before punting:


  (define-syntax-class prefab
    #:description "prefab struct pattern"
    #:attributes (match-pat)
    (pattern x:expr
             #:when (struct? (syntax-e #'x))
             #:with key (prefab-struct-key (syntax-e #'x))
             #:with (p:patt ...) (struct->list (syntax-e #'x))
             #:attr match-pat
             #'(app (λ (s) (and (struct? s)
                                (equal? (prefab-struct-key s) ???)
                                ???)))))

Support Racket 6.12?

The function and meta-function macros use the new ~? and ~@ patterns, which breaks compatibility with Racket 6.12. So far, I'm pretty happy with Racket 7.0. Is it worth the trouble to back-port?

customize error message for bad struct pattern

Got:

f.rkt> ((φ (F [a x] [b y]) (list x y)) (F 2 3))
; stdin::6191: struct*: not a structure definition
;   at: F
;   in: (struct* F ((a x) (b y)))
; Context:
;  /usr/share/racket/collects/racket/match/struct.rkt:10:2
;  /usr/share/racket/collects/syntax/apply-transformer.rkt:8:0
;  /usr/share/racket/collects/syntax/apply-transformer.rkt:18:0 local-apply-transformer5
;  /usr/share/racket/collects/racket/match/parse-helper.rkt:168:0 match-expander-transform
;  /usr/share/racket/collects/racket/match/gen-match.rkt:54:23 for-loop
;  /usr/share/racket/collects/racket/match/gen-match.rkt:53:11 mk
;  /usr/share/racket/collects/racket/match/gen-match.rkt:44:9 for-loop
;  /usr/share/racket/collects/racket/match/../../syntax/parse/private/parse.rkt:1040:13 dots-loop
;  /usr/share/racket/collects/racket/match/gen-match.rkt:23:0 go

add equality constraint to named wildcards?

For functions AND macros:

Make the pattern _x _y _x match 1 2 1 but not 1 2 3, and make sure the pattern _ _ _ still matches 1 2 3.

It could be done by making named wildcards normal variables in their own private scope.

add data->list back into algebraic/data

Not sure when it disappeared, but it wasn't supposed to.

The new one will be better:

  • a sum returns its products
  • an instance returns its product followed by its arguments
  • anything else becomes a singleton list

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.