pasterack
An evaluating pastebin for Racket.
pkg dependencies: ring-buffer, redis, irc, memoize, graph, lang-file
The Racket pastebin.
For example, try:
(: my-sqr (Real -> Real))
(define (my-sqr x)
(* x x))
(my-sqr 42)
Currently, I use the #:lang keyword argument in make-base-eval, but it complains about an import conflict with pretty.rkt.
Should at least be able to see side effecting outputs
http://pasterack.org/pastes/7728
#lang racket
(require pict)
(for/list [(i 25)]
(frame (rotate (scale (arrow 50 0) 2 1) (* pi (/ i 12)))
#:segment 5
#:color "blue"
#:line-width 1))
The following code that uses module+ and splicing let fails to run even though it should work perfectly well:
#lang racket
(require racket/splicing)
(splicing-let ()
(module+ test
5))
The issue is that the syntax-local-context inside of a splicing-let is a top-level-context, even though it 'should' be a module-context.
It would be great if there was an restfull API we could use so that we can have a button in DrRacket that submits to pasterack.
http://pasterack.org/pastes/22941
#lang racket
(require pict pict/balloon)
(let ([f (standard-fish 70 40)])
(pin-balloon (wrap-balloon (text "I am ⊥") 'sw -5 3)
(cc-superimpose (blank 300 150) f)
f
rt-find))
As far as I can tell, the environment that pasterack runs in prevents threads from working.
As shown in this example: http://pasterack.org/pastes/37074
For some reason, the evaluator allows writing to the file system.
No backtrace given. Just blows up. The paste itself is posted, but it blows up trying to talk to IRC. Bot down / broken ?
#lang racket
(require (for-syntax syntax/parse))
(define-match-expander let:
(lambda (stx)
(syntax-parse stx
[(_ ([e pat] ...) body)
#`(and (app (lambda (x)
(match x [body e]))
pat)
...)])))
(match (list 2)
[(let: ([(* y y) x])
`(,y))
x])
I've found myself making experimental pastes to poke at Racket's behavior when I have a local change in my own installation. It'd be nice to not add to the noise and take server space with throw-away programs. Will you add a checkbox that just evaluates the given code but doesn't paste it?
The representation of a paste in redis should really be a hash instead of a list.
Clicking on doc link in a paste does not leave the frame. So the url does not change to docs.racket-lang.org/...
example: http://pasterack.org/pastes/1848
I just went to PasteRack and tried a simple example. The problem is that I automatically marked the checkbox/captcha without reading the text "To paste as plaintext, check the box:".
I wanted to run the example and I vas very confused when I saw it as only plain text.
I think that the selection of the text/racket mode should be decoupled of the captcha.
Thanks @soegaard
try the data log example from racket-lang front page
What if one want to update their paste? or track for changes?
Make pasterack into a site with account may be overkill. A better approach imo is to support gist. Paste ids with "gist:" prefix should be looked up via gist API and then fetched and evaluated.
A gist hook should be made so that the gist will be evaluated only once each update.
https://developer.github.com/v3/activity/events/types/#gistevent
What do you think?
I think this is scribble's fault (see racket pr 14104) but logging an issue anyways. The racket docs say that codeblock should be verbatim (racketblock is the one that supports escapes).
Right now, something like #lang at-exp racket
does not work. Thanks @greghendershott.
A quick scan of the logs shows that most spam posts are from known spammer ips. Eg
"128.70.36.116"
"93.186.31.112" ; 78462
"8.37.227.32" ; 62710
"41.203.67.164" ; 40338
"41.203.67.164" ; 65175
"41.203.67.168" ; 39202
"70.39.187.244" ; 44180
"8.37.224.8" ; 38778
"8.37.227.147" ; 62694
"41.140.8.173" ; 91555
"70.39.185.182" ; 29288
"93.186.23.114" ; 27429
"93.186.31.112" ; 26228
"93.186.23.96" ; 70131
"93.186.31.113" ; 36938
"93.186.31.96" ; 53146
"93.186.31.81" ; 48601
"93.186.31.82" ; 99040
"93.186.23.80" ; 80496
"41.71.185.31" ; 51208
"23.236.124.165" ; 91179
"199.190.46.75" ; 49259
"199.190.46.75" ; 60459
"199.190.46.75" ; 83624
The site should automatically delete posts from known spammer ip addresses, perhaps using a service like this: https://www.stopforumspam.com/usage
Right now when pasting something that can't be read, it is treated as plain text.
This makes is hard to debug when accidentally making a syntax error in your program.
For some days now whenever I have attempted to use the 'Alert channel' option on pasterack.org I get the following:
Exception
The application raised an exception with the message:
tcp-write: error writing
system error: Broken pipe; errno=32
Stack trace:
<empty box appears here>
The paste is still added to the list, and I can access it by backing up to the main page and looking at the top link in the queue, generally, but no channel alert is sent.
http://pasterack.org/pastes/59526
Should throw a contract violation on "expected vector of string"
instead complains about a make-vector out of range...?
For example:
(require plot) ; and deriv^3(cos)
(define ((deriv f) x)
(/ (- (f x) (f (- x 0.001))) 0.001))
(define (thrice f) (lambda (x) (f (f (f x)))))
(plot (list (function ((thrice deriv) sin) -5 5)
(function cos -5 5 #:color 'blue)))
gives error Gtk initialization failed for display "0"
Maybe related to Racket PR12465?
Because scribble re-uses the same filename.
Try drawing serpinski, and then another circle in another paste and see that the serpinski image is used instead of a circle.
Right now pasterack incorrectly assumes that first line begins with #lang
.
Something like this should be ok
;; comment
#lang racket
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.