Re: [racket-users] Re: Slack team for racket

2015-07-31 Thread J Arcane
Wow, is it two way then?

On Fri, Jul 31, 2015 at 9:03 AM, Jack Firth  wrote:

> On Monday, July 27, 2015 at 1:15:31 AM UTC-7, mazert wrote:
> > Le 27/07/2015 04:13, Jason Yeo a écrit :
> > > Hi Everyone!
> > >
> > > For anyone out there who finds IRC too daunting and difficult to use,
> there's a slack team created just for racketlang at
> http://racket.slack.com. Get invites to the team at
> http://racket-slack.herokuapp.com.
> > >
> > > Cheers,
> > > Jason
> > >
> >
> > Hello,
> >
> > IRC and a Newsgroup/Mailing-list is largely enough. I think it is better
> > to centralize a community around 1-2 services, otherwise you have to
> > post your question on a lot of services to hope having an answer, or to
> > discuss about a specific subject.
> >
> > And honestly, if a developer finds that IRC is too complicated, he
> > should do something else ;). But for people who already use slack.com
> > why not !
>
> Note that the Slack channel is integrated with the IRC chat room so
> anything in IRC is visible in Slack
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] What limits would you put on racket?

2015-07-23 Thread J Arcane
>
>
> * Browser-side AJAX-y apps, both underlying browser stuff and layered
> frameworks/libraries.  Developing for this is largely about cursing
> frequently -- every time you're reminded that people who have little idea
> what they're doing have now determined the platforms that everyone must
> build upon.   Not only are the platforms bad, but way in which most
> developers now think about software development is a step backwards from
> what it was before: institutionalizing a mixture of clerical bureaucracy
> and cargo-cult kludging methodology.


I think this is basically the main advantage that Clojure has, besides the
unwillingness of pointy-haired bosses to part with the JVM.

The Clojure library ecosystem has a number of very powerful and
theoretically easy to use libraries for web development, and you can stick
to one language on front to back.

The downside of this comes in the fact that all this power tends to come in
the form of that most evil of combinations: heavy abstraction, plus
virtually nil documentation. No one seems to document anything in the world
of Clojure. You will frequently find yourself having to divine functions
from source code and test examples, and nothing will ever be explained.
Mostly you have to guess a lot.

In that respect, I actually found just doing an old-school back-end-only
app in Racket somewhat more pleasant, save for the advantages of
live-reloading you get with ClojureScript's Figwheel.

On the whole though, I feel your pain about web dev in general. The whole
thing feels like a tower-block built on gaffer tape. I feel like the pain
is largely unavoidable no matter what direction you go.

On Fri, Jul 24, 2015 at 3:57 AM, Neil Van Dyke  wrote:

> Hendrik Boom wrote on 07/23/2015 08:15 PM:
>
>> I've heard that half-life waswritten in a versino of Lisp. But the
>> battles in half-life tend to be short, so they explicitly called the
>> garbage collector between battles.
>>
>
> And now HL3 is merely delayed by a *really* long deferred GC cycle? :)
>
> But seriously, I'm idly toying with a game idea that needs uninterrupted
> smooth fast action (physics, graphics, world model, networking,
> controlling) for up to 5 minutes. A multiplayer game session is longer than
> 5 minutes, but is split into parts of up to 5 minutes, with brief
> GC-friendly gameplay pauses between the parts, and afterwards you return to
> the GC-friendly multiplayer lobby.  An issue with this sort of thing in
> GC'd languages is that you know you're going to have to deal with GC
> somehow, and you'll have to prove viability empirically, after considerable
> investment; but if you were using C/C++, what you have to prove empirically
> after considerable investment is that you can do it without memory bugs.
>
> Neil V.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: How to draw a 3D ball?

2015-07-20 Thread J Arcane
The images/icons library contains some tools for generating shaded shapes
which may be of use to you. It's what I used to generate my personal icon.
http://docs.racket-lang.org/images/Icons.html?q=images

On Mon, Jul 20, 2015 at 12:03 PM, Mianlai Zhou 
wrote:

> Hi,
>
> Thanks for your answer. I meant the former, i.e., a 2D pict of a ball with
> some shading to make it look 3D.
> Is there any quick way to do it or I have to implement the algorithm by
> myself?
>
> Thanks again.
>
>
> On Mon, Jul 20, 2015 at 8:38 AM, Jack Firth  wrote:
>
>> On Saturday, July 18, 2015 at 7:30:42 PM UTC-7, Mianlai Zhou wrote:
>> > Hi all,
>> >
>> >
>> > I am wondering how to change the following code of a 2D circle into a
>> 3D ball:
>> >
>> >
>> > (require slideshow)
>> > (colorize (filled-ellipse (* size 15) (* size 15)) "red")
>> >
>> >
>> >
>> > My intention is to make the picture look like a real ball in
>> 3-dimension. Is there such
>> > a function existing already in Racket?
>> >
>> >
>> > Thank you in advance.
>>
>> By "3D ball" do you want a 2D pict of a ball with some shading to make it
>> look 3D, or a 3D model of a ball? If it's the latter you can use the pict3d
>> package (raco pkg install pict3d):
>>
>>
>> (require pict3d)
>> (sphere origin 1)
>>
>> If you do this in DrRacket, the repl will show a window with a 3D ball
>> model in it. You can click it and use the arrow keys to change the angle
>> and position you view the ball from.
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] SteamOS / Steam Machine

2015-07-05 Thread J Arcane
Should be pretty easy. SteamOS is just a front-end running on top of Debian
Wheezy, to my understanding. Even uses APT. I don't know what they've
changed compared to the standard distro, but you can probably even just do
"apt-get install racket".

You could always give it a try:
http://store.steampowered.com/steamos/buildyourown

On Sun, Jul 5, 2015 at 12:17 AM, Neil Van Dyke  wrote:

> Just out of curiosity, anyone planning to use Racket somehow work on
> SteamOS, that you can say?
>
> (I'm idly toying with a moonlighting indie game idea that initially would
> target Steam Machines, because it needs monetization and console-type
> controllers, Valve seems like a good company to work with, SteamOS isn't
> saturated with top games like the current consoles and Windows, and the
> capital investment would be small enough that SteamOS revenue alone might
> be fine.  That's just a 5-second impression, biased by wanting a Valve
> console to work; I haven't done the financial due diligence yet.  The
> action part of the game would be twitchy fast 3D online multiplayer, so I
> don't know how much Racket could be used at run time for this kind of game,
> but maybe a winning opportunity would come up, like for the non-action game
> modes, or for end user extensibility.)
>
> Neil V.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] infix

2015-05-30 Thread J Arcane
Alex Knauth did up a simple infix solution for Heresy, based on the Maya
mini-DSL for Clojure, which I've finally got round to merging into the main
tree.

No docs yet, but you can see the code:
https://github.com/jarcane/heresy/blob/master/lib/infix-math.rkt
And the test cases should make the functionality pretty clear:
https://github.com/jarcane/heresy/blob/master/tests/infix-math.rkt

On Sat, May 30, 2015 at 10:32 PM, Jos Koot  wrote:

>  To whom is interested,
>
> https://gist.github.com/joskoot/797a9e7d2276cf59d747
>
>  A toy allowing infix notation to be embedded in Racket.
> Based purely on pattern matching of syntax-case.
> In many aspects differs from the infix of Jens Axel Søgaard.
> I probably never shall use it, but I had much fun making it.
> First time I made a parser without explicitly using a push down automaton.
> Docs are included in the source. Should be moved to scribble, of course.
>
> Best wishes, Jos
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket] Greetings!

2015-03-19 Thread J Arcane
I will second that. The performance difference between the racket dedicated
executable, and running something under a DrR REPL can be surprisingly
huge. It's one of the reasons why I've been slowly transitioning to using
racket-mode under Emacs instead.

On Thu, Mar 19, 2015 at 1:25 PM, Neil Toronto 
wrote:

> Welcome!
>
> Thank you for your past work. Trying to emulate it concretized and
> motivated almost all of my high school and undergraduate math classes.
>
> On 03/18/2015 02:59 PM, John Carmack wrote:
>
>> ...
>>
>> I have a specification for a VR related file format that is headed
>> towards JSON, but I am seriously considering changing it to s-expressions
>> and embedding a trivial (not Racket) Scheme for scripting.
>>
>
> What kind of Scheme did you have in mind?
>
> It's not terribly hard to embed Racket, nor to create a "#lang" language
> that gives access to only the leanest parts of the language and libraries.
>
> On the other hand, it's easy to write a Scheme interpreter. But you don't
> get the JIT, optimizer, and other goodies.
>
>  I'm teaching my son with Racket.  He has worked in a few different
>> imperative languages prior.
>>
>
> If he's interested in 3D, he might like Pict3D, a 3D engine written in
> Racket that has a purely functional interface. (Most of the internals are
> purely functional as well.) Disclaimer: the API is stable, but I'm still
> expanding it, and I haven't used my own kids as guinea pigs yet.
>
>  I would be interested in hearing any guidance for high performance
>> servers written in Racket.  GC delays in the tens of milliseconds will be
>> problematic for at least part of this application, but I could split that
>> part off into a separate server and still leave the other part in Racket if
>> necessary.  The main benefit is currently development productivity, so
>> obnoxious micro-architectural optimizations aren't useful, but broad
>> strategic guidelines would be appreciated.
>>
>
> Listen to Jay. :) He doesn't use DrRacket, though, so he's left something
> out.
>
> When you do performance testing and statistical profiling, it's fine to
> use DrRacket if you turn off debugging and (the other) profiling support,
> and uncheck "Preserve stacktrace" in the "Choose Language" dialog.
>
> But when measuring GCs, run programs from the command line. DrRacket and
> its tools use a lot of heap. In their initial state, this adds about 10ms
> to minor collections and 500ms to major collections. Using Typed Racket
> will magnify the differences because its compile-time analysis is quite
> memory-heavy.
>
> Neil ⊥
>
>
> 
>  Racket Users list:
>  http://lists.racket-lang.org/users
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Crowdsourcing Pict3D's design

2015-03-09 Thread J Arcane
I'm really curious about this. I've never touched 3D, partly because most
3D frameworks/libraries are hardcore C/C++.

A 3d big-bang gives me happy thoughts.

On Mon, Mar 9, 2015 at 9:37 PM, Alexander D. Knauth 
wrote:

> Is there a good way to draw a smooth curved cylinder?
>
> On Mar 8, 2015, at 10:53 PM, Neil Toronto  wrote:
>
> > Pict3D is finally ready for public consumption. You can install the
> package either in DrRacket using "File -> Install Package..." or from the
> command line using
> >
> >raco pkg install pict3d
> >
> > The GitHub page is here:
> >
> >https://github.com/ntoronto/pict3d
> >
> > All features are documented. The API is stable. I've verified that it
> runs on Racket 6.1.1 and the current development version. There are reports
> of it working on at least two Windows systems, two Mac OS X systems, and
> two Linux systems. It might not eat your graphics card.
> >
> > Current features:
> >
> > * Works in untyped and Typed Racket
> >
> > * Spheres, rectangles, triangles and quads with per-vertex attributes
> >
> > * A system of groups and affine (arbitrary parallel-line-preserving)
> >   transformations for sticking Pict3Ds together
> >
> > * Ray-against-scene and line-against-scene collision detection
> >
> > * Render targets: an interactive debugging view in DrRacket's REPL,
> >   `pict3d->bitmap` and `pict3d-canvas%`
> >
> > * big-bang3d (currently without networking)
> >
> > --
> >
> > Now we get to crowdsourcing.
> >
> > I've reached the limits of what I can do without working on Pict3D
> full-time. In particular, I don't know whether the API is awkward or
> actually quite nice for the uses it'll be put to. I've drawn on some
> personal game design and coding experience, but that only goes so far.
> >
> > This is where you come in.
> >
> > If you've ever had the slightest hankering to do some real 3D but
> avoided it because of the pain that usually goes with it, try Pict3D. (If
> it fails to work, please submit a bug report on the GitHub page.) Got a
> visualization project? Try Pict3D. Want to make a game? Try Pict3D's
> version of Big Bang. Want to just fool around in 3D space for a bit? Try
> Pict3D, and report back on how it goes.
> >
> > Anything is fair game for criticism, praise or suggestions: groups and
> pinning, distinguishing direction and position vectors, presence or lack of
> shapes you need, how to allow shader programming, file formats that would
> be nice to import models from, information that would be nice to have in
> the interactive debugging view, how to add texturing to the API, and even
> the tone of the documentation.
> >
> > I'm looking forward to your reports, all my little minions. Wait, did I
> say that out loud?
> >
> > Neil ⊥
> > 
> > Racket Users list:
> > http://lists.racket-lang.org/users
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] try-racket alternative

2015-02-25 Thread J Arcane
Oh wow! This is quite lovely. Definitely an improvement so far, in my book.

I believe that the one included in try-racket is mostly based upon the
Quick Guide: http://docs.racket-lang.org/quick/ The examples are largely
similar, I think just a few things were tweaked or abbreviated.

The state of the web front-end is mostly unmodified because I simply didn't
have much in the way of web-design skills when I took on the project. I
treated the JS side in particular as little more than a black box. I've
picked up some JS/HTML since, but my skills as an admin or a web dev still
leave a lot to be desired.

Ultimately, my interest has always been in just seeing to it that there was
a high-quality online repl available for Racket somewhere, and at the time,
none was hosted, so I took up the repo because I needed to be able to
easily push changes to get it working.

This is all just a rambling lead up to say that I really like what you've
done with the thing, and to be perfectly honest would be quite happy to
hand over the domain.

On Wed, Feb 25, 2015 at 11:57 PM, Floyd Arguello 
wrote:

>  Thank you!
>
> They are enjoying Racket - Realm of Racket is a phenomenal book.
>
> Floyd
>
>  On Feb 25, 2015, at 3:30 PM, Sam Tobin-Hochstadt 
> wrote:
>
> This is really nicely done! I hope your daughters are enjoying Racket
> as well. :)
>
> Sam
>
> On Wed, Feb 25, 2015 at 4:11 PM, Floyd Arguello
>  wrote:
>
>  I found that my daughters had a lot of questions when they went through
> the
> tutorial at http://try-racket.org/ - what’s a function? What’s a binding?
> Lambda? Lexical scope?
>
> So, I thought I’d create an alternative to try-racket - for kids ages 12
> and
> up, give or take.
>
> With that in mind, I forked https://github.com/jarcane/try-racket,
> applied a
> new design, and added:
>
> * the bootstrap js framework
> * the ability to clear and reset the console (doesn’t clear pictures yet)
> * multi-line entries in the console - auto indents at 2 spaces (needs more
> work)
>
> I also removed “context” from the error messages - to keep the errors short
> and sweet.
>
> It’s very much a work in progress, but you can see it here:
> http://trycode.io/
>
> As for the content, one idea is to rewrite the tutorial for a younger, less
> experienced crowd, and use the “info” box in the lower left to provide
> additional information, terminology, context, etc…
>
> Another idea is to write a simple, text-based game; though it lacks the
> instant gratification of a picture appearing in the console.
>
> Any ideas/feedback?
>
> Anyone want to pitch in? :)
>
> https://github.com/arguello/trycode.io
>
> Thanks,
> Floyd
>
>
>
>
>
>
>
>
>
>
>
>
> 
> Racket Users list:
> http://lists.racket-lang.org/users
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Documentation not building on the pkg.racket-lang.org

2015-01-07 Thread J Arcane
Wheyhey! Heresy has pretty Scribble docs online now:
http://pkg-build.racket-lang.org/doc/heresy/index.html

Thanks!

On Wed, Jan 7, 2015 at 6:32 AM, Jack Firth  wrote:

> So *that's* why none of my docs were updating
>
> On Tue, Jan 6, 2015 at 8:25 PM, Matthew Flatt  wrote:
>
>> A power failure took the pkg-build service down a week ago, and I
>> didn't notice. I've turned the machine back on. (Yep, it's time to put
>> better monitoring in place.)
>>
>> At Wed, 07 Jan 2015 03:18:22 +, Spencer Florence wrote:
>> > Hey Y'all,
>> >
>> > I'm trying to get the documentation for one of my packages (named
>> cover) to
>> > appear on pkg.racket-lang.org. Currently the webpage shows the
>> > documentation as crossed out.
>> >
>> > I suspect this is because the old documentation file was renamed (when I
>> > did this I had to reinstall the package locally to get the
>> documentation).
>> > Is there some way to avoid/fix this?
>> >
>> > --spf
>> > 
>> >   Racket Users list:
>> >   http://lists.racket-lang.org/users
>> 
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>>
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Why does (case ...) quote its matching value expressions?

2014-12-24 Thread J Arcane
That is a lot more brief than mine. I just adapted a naive, unquoted
version from the Racket case:

(define-syntax my-case
  (syntax-rules (else)
[(_ val ((mtch ...) expr) rest ... (else expr2))
 (if (my-comp val (mtch ...))
 expr
 (my-case val rest ... (else expr2)))]
[(_ val ((mtch ...) expr) (else expr2))
 (if (my-comp val (mtch ...))
 expr
 expr2)]
[(_ val (else expr)) expr]
[(_ val ((mtch ...) expr) rest ...)
 (my-case val ((mtch ...) expr) rest ... (else #f))]))

(define-syntax my-comp
  (syntax-rules ()
[(_ v ()) #f]
[(_ v (k)) (equal? v k)]
[(_ v (k ks ...)) (if (equal? v k)
  #t
  (my-comp v (ks ...)))]))

On Tue, Dec 23, 2014 at 8:29 PM, Eli Barzilay  wrote:

> On Mon, Dec 22, 2014 at 12:52 AM, Jon Zeppieri  wrote:
> > `case` is like C's `switch` (but unlike similar constructs in other
> > C's switch does, however, allow the use of constant *expressions* as
> > case labels, so you can have something like `case FOO % 3`, where `FOO
> > % 3` can be computed at compile-time.
>
> (define-syntax (case* stx)
>   (syntax-case stx ()
> [(_ what [v e ...] ...)
>  (with-syntax ([(v* ...) (generate-temporaries #'(v ...))])
>#'(let-syntax ([foo (λ(_) (with-syntax ([(v* ...) (list v ...)])
>#'(case what [(v*) e ...] ...)))])
>foo))]))
>
> (case* 3
>   [1 2]
>   [(+ 1 2) 4])
>
> --
>   ((lambda (x) (x x)) (lambda (x) (x x)))  Eli Barzilay:
> http://barzilay.org/   Maze is Life!
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Why does (case ...) quote its matching value expressions?

2014-12-22 Thread J Arcane
Thanks for the insight. I hadn't considered the performance implications
involved I suppose (the perpetual problem of the young Lisper ...)

And evcase does indeed work more like I expected, for example:

(for ([n (in-range 1 101)])
  (evcase 0
  ((+ (modulo n 5)
  (modulo n 3)) (displayln "FizzBuzz"))
  ((modulo n 5) (displayln "Buzz"))
  ((modulo n 3) (displayln "Fizz"))
  (else (displayln n

Works exactly as I'd expect. I'll have a look at the code and see if any
further insights might be found there for Heresy's (select case ...)

Thanks!

On Mon, Dec 22, 2014 at 5:20 PM, Matthias Felleisen 
wrote:

>
> Look for evcase. -- Matthias
>
>
> On Dec 21, 2014, at 11:58 PM, J Arcane wrote:
>
> > Up with a horrible ear-ache this morning I decided to include a FizzBuzz
> example in Heresy, the Racket #lang I've been working on, and ran into an
> unexpected behavior in the (case ...) statement.
> >
> > In many languages with case, you can make the testing value a constant,
> and then make the matching clauses actual calculations which then match
> against that constant. So when doing FizzBuzz in C-like languages you can
> do something like "switch 0" and then "case x % 3" for the matching clauses.
> >
> > It turns out this doesn't work in Racket, because Racket quotes the
> values in the matching clauses so they do not evaluate. Specifically, it
> narrows down to doing this in (case/sequential-test ...): #`(equal? v 'k)
> >
> > I can implement an alternate version that works as I expect (and will
> probably include it in Heresy) just by removing that quote in my version,
> but I was curious as to the reasoning behind this behavior and if perhaps
> there's some explanation for it that I may've missed.
> >
> > Any insights appreciated,
> > John Berry
> >
> > 
> >  Racket Users list:
> >  http://lists.racket-lang.org/users
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Why does (case ...) quote its matching value expressions?

2014-12-21 Thread J Arcane
Up with a horrible ear-ache this morning I decided to include a FizzBuzz
example in Heresy, the Racket #lang I've been working on, and ran into an
unexpected behavior in the (case ...) statement.

In many languages with case, you can make the testing value a constant, and
then make the matching clauses actual calculations which then match against
that constant. So when doing FizzBuzz in C-like languages you can do
something like "switch 0" and then "case x % 3" for the matching clauses.

It turns out this doesn't work in Racket, because Racket quotes the values
in the matching clauses so they do not evaluate. Specifically, it narrows
down to doing this in (case/sequential-test ...): #`(equal? v 'k)

I can implement an alternate version that works as I expect (and will
probably include it in Heresy) just by removing that quote in my version,
but I was curious as to the reasoning behind this behavior and if perhaps
there's some explanation for it that I may've missed.

Any insights appreciated,
John Berry

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Splicing a variable to serve as let declarations

2014-12-11 Thread J Arcane
Hmm, perhaps this would be easier to define the problem if I were to share
the code for where this has to go.

Currently, my struct system looks like this:
https://github.com/jarcane/heresy/blob/master/lib/things.rkt

Now, as it stands this works quite well as an opaque data structure, but
they can in theory be extended into a full blown object system if we store
lambdas in one of our Things. This is at the moment kind of a useless
gesture though, it's not clear they can self-reflect from within the same
scope.

But! If we can wrap a second let around the first there, that expands our
alist into defining each field as an individual local variable, then any
function called with our regular syntax would be able to refer to the
variables of the parent function. I've tested this in toy form, and the
scoping does appear to support it.

But we need the expanding let to do it, and so far I've failed to come up
with a way, and the solutions thus far require manual operations, not
something general. The last two posts have the same 'out of context'
problem if they attempt to operate on the argument of the Thing function,
because it's not an explicit value being declared manually, but using an
existing variable in the function that we need.

Perhaps Things need to start from scratch as a full macro, but the problem
I ran into was the recursive call used for returning a Thing copy just
creates an infinite loop if done as a macro. It's fine as a function.


On Thu, Dec 11, 2014 at 10:10 PM, Alexander D. Knauth 
wrote:
>
> Or you don’t even need a syntax-parameter:
> #lang racket
> (require (for-syntax syntax/parse))
> (define-syntax letexpand
>  (syntax-parser
>[(_ alst body ...)
> (with-syntax ([alst (syntax-local-introduce #`#,(syntax-local-value
> #'alst))])
>   #'(let alst body ...))]))
> (define (foo)
>   (define-syntax dave '((is 5) (fat 6)))
>   (letexpand dave is fat))
> (foo)
>
> On Dec 11, 2014, at 6:52 AM, Roman Klochkov  wrote:
>
> #lang racket
> (require (for-syntax syntax/parse) racket/stxparam)
>
> (define-syntax letexpand
>   (syntax-parser
>   [(_ alst body ...)
> (with-syntax ([alst (syntax-local-introduce
> #`#,(syntax-parameter-value #'alst))])
> #'(let alst body ...))]))
>
> (define (foo)
> (define-syntax-parameter dave '((is 4) (fat 6)))
> (letexpand dave is fat))
>
> (foo)
>
>
>
> Tue, 9 Dec 2014 06:33:14 +0200 от J Arcane :
>
> Hmm. That does appear to work at a global level, but then when you attempt
> to use it inside of a function it returns "identifier used out of context".
> Trying to define-for-syntax in a local context also causes problems;
> "begin-for-syntax: not in a definition context in: (begin-for-syntax
> (define-values (z) lst))"
>
> On Mon, Dec 8, 2014 at 10:17 PM, Alexander D. Knauth  > wrote:
>
> Would something like this work for what you want?
>
> #lang racket
> (require (for-syntax syntax/parse))
> (define-for-syntax dave '((is 5) (fat 6)))
> (define-syntax letexpand
>   (syntax-parser
> [(_ alst body ...)
>  (with-syntax ([alst (syntax-local-introduce #`#,(eval-syntax
> #'alst))])
>#'(let alst body ...))]))
> (letexpand dave is fat)
>
> On Dec 8, 2014, at 2:46 AM, J Arcane  wrote:
>
> > I've been experimenting with a new feature for Heresy, and I find myself
> in need of a macro that can insert the contents of an a-list into a let
> syntax to serve as its definitions. I am utterly failing to accomplish
> this. It seems like it should be simple enough to splice a variable's
> contents into the syntax, and in a sense it is, but not if I want it to
> actually then evaluate.
> >
> > For example, I can do this:
> >
> > (define dave '((is 5) (fat 6)))
> >
> > (define-syntax letexpand
> >   (syntax-rules ()
> > [(_ alst body ...)
> >  #`(let #,alst body ...)]))
> >
> > (letexpand dave is fat)
> >
> > Which returns a syntax object which looks like what I want:
> >
> > #
> >
> > But doesn't actually the evaluate that object. But doing that with
> merely (let alst body ...) creates an error because rather than splicing
> alst's contents itself, it merely inserts the variable name given, and then
> fails because let doesn't recognize it. It will work with a handwritten
> unquoted alist in that space, but this is largely useless because of course
> that's what let already basically does anyway.
> >
> > Am I starting in the wrong place here, and if not, how do I turn that
> syntax object into something that actually evaluates?
> > 
> >  Racket Users list:
> >  http://lists.racket-lang.org/users
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
>
> --
> Roman Klochkov
>
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] SOURCES FOR BUILDING BASIC WEB APPLICATIONS

2014-12-08 Thread J Arcane
try-racket's a bit dependent on external JavaScript libraries and other
oddness to get at the basics.

I'd instead suggest as Neil does, try the tutorials on the main Racket
page.

I've also done HateStack, which is a far simpler application example for a
simple disposable blog like thing: https://github.com/jarcane/HateStack
Might be a better example of the basics than try-racket.

On Tue, Dec 9, 2014 at 1:11 AM, Andrew Ulrich  wrote:

> Check out the following source code:
> https://github.com/jarcane/try-racket
> If I remember correctly, it's got a racket webserver running an
> application to run commands against a racket sandbox. So at least you'll
> see how to set up your webserver and run logic on the back end.
>
> Andrew Ulrich
>
> On Mon, Dec 8, 2014 at 5:04 PM, Animesh Pandey <
> animeshpandey.e...@gmail.com> wrote:
>
>> Hi,
>> I wanted to know if there are any sources where I can find some sources
>> for building web applications in Racket? I want to write an application for
>> a basic HTTP request-response.
>> I looked at the documentation but I can't really understand whats going
>> on.
>> Any help would be appreciated.
>>
>> Thanks and regards,
>> Animesh Pandey
>>
>> 
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>>
>>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Splicing a variable to serve as let declarations

2014-12-08 Thread J Arcane
Hmm. That does appear to work at a global level, but then when you attempt
to use it inside of a function it returns "identifier used out of context".
Trying to define-for-syntax in a local context also causes problems;
"begin-for-syntax: not in a definition context in: (begin-for-syntax
(define-values (z) lst))"

On Mon, Dec 8, 2014 at 10:17 PM, Alexander D. Knauth 
wrote:

> Would something like this work for what you want?
>
> #lang racket
> (require (for-syntax syntax/parse))
> (define-for-syntax dave '((is 5) (fat 6)))
> (define-syntax letexpand
>   (syntax-parser
> [(_ alst body ...)
>  (with-syntax ([alst (syntax-local-introduce #`#,(eval-syntax
> #'alst))])
>#'(let alst body ...))]))
> (letexpand dave is fat)
>
> On Dec 8, 2014, at 2:46 AM, J Arcane  wrote:
>
> > I've been experimenting with a new feature for Heresy, and I find myself
> in need of a macro that can insert the contents of an a-list into a let
> syntax to serve as its definitions. I am utterly failing to accomplish
> this. It seems like it should be simple enough to splice a variable's
> contents into the syntax, and in a sense it is, but not if I want it to
> actually then evaluate.
> >
> > For example, I can do this:
> >
> > (define dave '((is 5) (fat 6)))
> >
> > (define-syntax letexpand
> >   (syntax-rules ()
> > [(_ alst body ...)
> >  #`(let #,alst body ...)]))
> >
> > (letexpand dave is fat)
> >
> > Which returns a syntax object which looks like what I want:
> >
> > #
> >
> > But doesn't actually the evaluate that object. But doing that with
> merely (let alst body ...) creates an error because rather than splicing
> alst's contents itself, it merely inserts the variable name given, and then
> fails because let doesn't recognize it. It will work with a handwritten
> unquoted alist in that space, but this is largely useless because of course
> that's what let already basically does anyway.
> >
> > Am I starting in the wrong place here, and if not, how do I turn that
> syntax object into something that actually evaluates?
> > 
> >  Racket Users list:
> >  http://lists.racket-lang.org/users
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Splicing a variable to serve as let declarations

2014-12-07 Thread J Arcane
I've been experimenting with a new feature for Heresy, and I find myself in
need of a macro that can insert the contents of an a-list into a let syntax
to serve as its definitions. I am utterly failing to accomplish this. It
seems like it should be simple enough to splice a variable's contents into
the syntax, and in a sense it is, but not if I want it to actually then
evaluate.

For example, I can do this:

(define dave '((is 5) (fat 6)))

(define-syntax letexpand
  (syntax-rules ()
[(_ alst body ...)
 #`(let #,alst body ...)]))

(letexpand dave is fat)

Which returns a syntax object which looks like what I want:

#

But doesn't actually the evaluate that object. But doing that with merely
(let alst body ...) creates an error because rather than splicing alst's
contents itself, it merely inserts the variable name given, and then fails
because let doesn't recognize it. It will work with a handwritten unquoted
alist in that space, but this is largely useless because of course that's
what let already basically does anyway.

Am I starting in the wrong place here, and if not, how do I turn that
syntax object into something that actually evaluates?

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] jQuery.console or Racket code?

2014-11-26 Thread J Arcane
Hello,

I'm the webmaster/maintainer for try-racket at the moment. The JQuery
console is used to provide the console interface, but this is indeed only
an interface. I/O is passed via JSON to a running Racket sandbox provided
by the server application (itself also written in Racket). Racket does all
the heavy lifting for evaluating the code.

On Tue, Nov 25, 2014 at 12:29 PM, Chrakhan Barzanji <
chrakhan.barza...@gmail.com> wrote:

> hi,
>  could some body tell me if TryRacket-Online uses only the jquery-console
> implementation to evaluate the inputs or calls somehow the RacketCode
> (main.rkt & co.)
> https://github.com/jarcane/try-racket and http://try-racket.org/
> thanks
>
> ChB
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Providing/importing user lang modules.

2014-11-23 Thread J Arcane
Thanks!

Restructuring things this way does in fact appear to work. It means I still
have to cross reference stuff a bit when writing the libs, but I can safely
now pen a standard library and then just provide the lot in a new simpler
main.rkt.

You can see the result here:
https://github.com/jarcane/heresy/tree/refactoring1

On Sun, Nov 23, 2014 at 3:50 PM, Gustavo Massaccesi 
wrote:

> You should split the language in three parts:
>
> 1) The heresy/pre-base language (or heresy/private/pre-base) that
> implements the basic syntax (no pun intended), for example 'if',
> 'def', ... (probably most of the current content of heresy/main)
>
> 2) The libraries, for example heresy/lib/string that implements for
> example 'mid', 'left', 'right', ... (I still miss 'right', I have a
> definition of 'string-right' in my personal racket library.)The
> libraries can be written mostly in heresy/pre-base, with a little part
> of racket. Perhaps split that in low-level libraries that use some
> racket and high-level libraries that use only a restricted version of
> heresy (pre-base + low-level libraries).
>
> 3) The heresy language, that reexports all from heresy/pre-base and
> the libraries.
>
> If you see he implementation of racket, it starts with a #%kernel
> language. Then it constructs the racket/pre-base language with more
> features. Then it constructs the racket/base and racket languages.
> (Perhaps it has more intermediate steps that I missed.)
>
>
> https://github.com/plt/racket/blob/master/racket/collects/racket/private/base.rkt
>
> Gustavo
>
>
> On Sat, Nov 22, 2014 at 3:47 PM, J Arcane  wrote:
> > Today I decided to set about writing some standard library functions for
> > Heresy. My goal is to write as much as I can in Heresy proper, only
> falling
> > back to the Racket core when I need to provide a missing feature.
> >
> > The trouble I'm having though, is in making any of this code available to
> > other Heresy code or providing it as part of the standard language. I
> just
> > run into circular dependency issues; my lang depends on the core, and if
> the
> > core depends on the library ... round and round we go.
> >
> > I'm baffled as to how I can extend my language in my own language if I
> can't
> > actually provide the functions I create for it. How do I write in my lang
> > and the provide the results such that future programs can use them, or
> > especially, so that the files in my library can safely reference each
> other?
> >
> > As always, the code is here: https://github.com/jarcane/heresy
> >
> > Thank you,
> > John Berry
> >
> > 
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
> >
>

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Providing/importing user lang modules.

2014-11-22 Thread J Arcane
Today I decided to set about writing some standard library functions for
Heresy. My goal is to write as much as I can in Heresy proper, only falling
back to the Racket core when I need to provide a missing feature.

The trouble I'm having though, is in making any of this code available to
other Heresy code or providing it as part of the standard language. I just
run into circular dependency issues; my lang depends on the core, and if
the core depends on the library ... round and round we go.

I'm baffled as to how I can extend my language in my own language if I
can't actually provide the functions I create for it. How do I write in my
lang and the provide the results such that future programs can use them, or
especially, so that the files in my library can safely reference each other?

As always, the code is here: https://github.com/jarcane/heresy

Thank you,
John Berry

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] way off-topic but fun Re: Can't get my language package to work

2014-11-18 Thread J Arcane
Realm of Racket is quite good. I wish the sections on macros and languages
could've been longer, they went a long way to finally demystifying them for
me!

On Tue, Nov 18, 2014 at 3:59 PM, Matthias Felleisen 
wrote:

>
> On Nov 18, 2014, at 5:58 AM, J Arcane  wrote:
>
> > I think the "weirdness" and "difficulty" of Lisp syntax is mostly
> overstated anyhow, if I could get a handle at that age on the madness that
> was most languages then, and if kids now can get a handle on JavaScript of
> all things, I don't think the parens are so scary.
>
> +ω
>
>
> > I'll leave that to the Racket team. ;)
>
>
> See Realm of Racket. It explicitly expects that someone has been exposed
> to a so-called programming course.
>
> -- Matthias
>
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Can't get my language package to work

2014-11-18 Thread J Arcane
I played with Color Logo as a kid, and recall it fondly in part because I
think it was the only encounter with the language that demonstrated
anything like actual programming (the book even contains a later chapter
teaching recursion) or the language's Lisp-y roots. The trouble with it was
that most of the use of LOGO never really got to that at the time: it was
just more 'make the computer do a thing!' When I did LOGO in school on the
Apple IIs, they never even showed us past the prompt and basic FD/LT/RT
etc. When I got hold of Color Logo and found an actual screen editor, my
young mind only having been exposed to line-edited BASIC by that point, I
was floored.

But I think most people only ever got that FD/LT/RT demonstration, made a
few squares and circles, and then promptly moved to BASIC. And the home
versions of Logo in those days diluted the language with piles of very
un-LISP things like including actual GOTO tags and so forth (Color Logo
even included it's own bizarre and incomprehensible DSL for drawing new
turtle icons:
https://archive.org/stream/Color_Logo_1982_Micropi#page/n95/mode/2up) And
that low-end of the LOGO experience really serves to do nothing so much as
cement a very imperative way of thinking about how to operate the computer.

I did look at the sweet-expressions implementation, and I think with that
you get something that looks more QBASIC or LOGO-like in syntax, but found
that it didn't work with the REPL (expressions still expected parens to
evaluate). I think the "weirdness" and "difficulty" of Lisp syntax is
mostly overstated anyhow, if I could get a handle at that age on the
madness that was most languages then, and if kids now can get a handle on
JavaScript of all things, I don't think the parens are so scary.

If Heresy becomes a proper teaching tool instead of just a toy, I'm more
interested in using it to teach functional thinking and ease the transition
from BASICs to Lisp, than teaching programming from scratch. I'll leave
that to the Racket team. ;)

On Mon, Nov 17, 2014 at 1:38 AM, Matthias Felleisen 
wrote:

>
> Racket supported some Logo flavors for a while. I am sure they'd be easy
> to resurrect. -- The bad part isn't that Logo isn't just dysfunctional
> (isn't that the right word for "not functional") but don't help kids with
> anything. -- Matthias
>
>
>
>
>
>
>
> On Nov 16, 2014, at 12:23 PM, Byron Davies wrote:
>
> John,
>
> If you’re working on a BASIC-like Lisp, may I suggest Seymour Papert’s
> Logo language http://c2.com/cgi/wiki?LogoLanguage.
>
> This is a line-oriented language developed for kids, with Lisp-like
> semantics, developed originally for Turtle graphics.  Since there’s already
> a Turtle package in Racket, perhaps you could create a full-up Logo in
> Racket.  Not functional, but still cool.
>
> Byron
> =
> Byron Davies, Ph.D. — 480-276-4285
> Chief Learner and Director of K-12 Innovation
> bdav...@starshineacademy.org
> http://StarShineAcademy.org
>
>
> On Nov 16, 2014, at 10:00 AM, users-requ...@racket-lang.org wrote:
>
> Message: 2
> Date: Sun, 16 Nov 2014 11:20:00 +0100
> From: Konrad Hinsen 
> To: J Arcane 
> Cc: Racket Users 
> Subject: [racket]   Can't get my language package to work.
> Message-ID:
> <21608.31312.613882.412697@Mac-mini-de-Administrateur.local>
> Content-Type: text/plain; charset=us-ascii
>
> J Arcane writes:
>
> I've been tinkering about with a BASIC-inspired Lisp syntax in Racket to
> practice
> macros. I've now got all the basic definitions established and wanted to
> thus start
> working on making it usable as a language, at least with #lang s-expr but
> I'm failing
> even at that. I can't even get my file to import and function with
> (require).
>
>
> The best starting point I found for implementing languages in Racket is
> this
> article by Matthew Flatt:
>
>  https://queue.acm.org/detail.cfm?id=2068896
>
> You can download all the examples and play with them. I suggest you
> take his version based on s-expr and modify it in small steps toward
> your own language. It's always easier to modify working code than to
> start from scratch.
>
> Konrad.
>
>
> 
>  Racket Users list:
>  http://lists.racket-lang.org/users
>
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Can't get my language package to work.

2014-11-16 Thread J Arcane
With help from soegaard in the channel, we got it working; turns out the
issue was failing to declare syntax literals externally from the macros
they're used in. Works great within a module, but Racket gets cranky if
they aren't explicitly named and exported.

It's working now, you can find it on Github:
https://github.com/jarcane/heresy

On Sun, Nov 16, 2014 at 12:20 PM, Konrad Hinsen 
wrote:

> J Arcane writes:
>
>  > I've been tinkering about with a BASIC-inspired Lisp syntax in Racket
> to practice
>  > macros. I've now got all the basic definitions established and wanted
> to thus start
>  > working on making it usable as a language, at least with #lang s-expr
> but I'm failing
>  > even at that. I can't even get my file to import and function with
> (require).
>
> The best starting point I found for implementing languages in Racket is
> this
> article by Matthew Flatt:
>
>   https://queue.acm.org/detail.cfm?id=2068896
>
> You can download all the examples and play with them. I suggest you
> take his version based on s-expr and modify it in small steps toward
> your own language. It's always easier to modify working code than to
> start from scratch.
>
> Konrad.
>

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Can't get my language package to work.

2014-11-16 Thread J Arcane
Greetings,

I've been tinkering about with a BASIC-inspired Lisp syntax in Racket to
practice macros. I've now got all the basic definitions established and
wanted to thus start working on making it usable as a language, at least
with #lang s-expr but I'm failing even at that. I can't even get my file to
import and function with (require).

If I provide all-defined-out, I get syntax errors for everything. If I
provide it for-syntax, I don't get syntax errors, but instead it tells me
there are unbound identifiers. Similar results occur when trying to just
require the file, and switching from '#lang s-expr "main.rkt"' to #lang
s-expr syntax/module-reader just switches which of those require methods
causes which error.

You can see the code on the Github now, it's a bit of a mess because
there's a lot of notes about what's being imported/renamed from Racket in
the comments: https://github.com/jarcane/heresy

Help?

John Berry

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Electric-pair like setting for square brackets in DrRacket on Windows?

2014-11-05 Thread J Arcane
I've checked the modes and the 'automatically adjust' setting and both are
set properly, but I still get the same result. If I type a [, I get a [ and
that's it, no matching ] gets inserted automatically, as I get when I type
a (.

On Wed, Nov 5, 2014 at 4:40 AM, Robby Findler 
wrote:

> I just push a fix for one such bug: when you type control-[ in that
> mode, then you (used to) get only one bracket. Is that what you're
> found?
>
> Robby
>
>
> On Tue, Nov 4, 2014 at 11:47 AM, J Arcane  wrote:
> > Greetings,
> >
> > I started Lisping on Emacs and grew to rather appreciate the
> > electric-pair-mode method for automatically inserting a closing parens
> and
> > other symbols; I had mine set to auto close (), [], and "" at a minimum,
> and
> > sometimes set others when I was working in other languages.
> >
> > DrRacket has a setting to do this for (), but at least on the Windows
> > version it doesn't seem to support this for []; I've fiddled with
> settings
> > and they seem to make no difference in behavior.
> >
> > Odd thing is, on FreeBSD I could swear auto-closing square brackets
> worked
> > last I used it (though my BSD install is stuck on console mode for now
> so I
> > can't check).
> >
> > Am I missing something, is this a bug, or just a feature not present in
> the
> > Windows version?
> >
> > Thanks,
> > John Berry
> > http://jarcane.github.com
> > http://try-racket.org
> >
> > 
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
> >
>

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Electric-pair like setting for square brackets in DrRacket on Windows?

2014-11-04 Thread J Arcane
Greetings,

I started Lisping on Emacs and grew to rather appreciate the
electric-pair-mode method for automatically inserting a closing parens and
other symbols; I had mine set to auto close (), [], and "" at a minimum,
and sometimes set others when I was working in other languages.

DrRacket has a setting to do this for (), but at least on the Windows
version it doesn't seem to support this for []; I've fiddled with settings
and they seem to make no difference in behavior.

Odd thing is, on FreeBSD I could swear auto-closing square brackets worked
last I used it (though my BSD install is stuck on console mode for now so I
can't check).

Am I missing something, is this a bug, or just a feature not present in the
Windows version?

Thanks,
John Berry
http://jarcane.github.com
http://try-racket.org

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Unquoting a variable without unquoting its contents?

2014-09-25 Thread J Arcane
http://try-racket.org continues to splutter to life, but there's still
something of a glaring error in that it doesn't really like list or quote
at all.

AlexKnauth has narrowed the problem down here:
https://github.com/jarcane/try-racket/issues/4#issuecomment-56751603

It seems that unquoting a variable does funny things to the variable's
contents when they contain a bare quoted list or symbol, so we get weird
results and errors. Quotes get lost, and then the eval finds itself looking
at mangled forms.

The best I can think of to do is maybe make a simple macro rather than
using quasiquote? Any ideas?

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Hosting the try-racket REPL.

2014-09-22 Thread J Arcane
It's a known issue. Alex Knauth has submitted a rough solution to my fork
of it; I'll get it merged and pushed to the server shortly.

On Tue, Sep 23, 2014 at 12:11 AM, Steve Graham  wrote:

> I get errors when trying to type in a multi-line function.  Am I doing
> something wrong?
>
>   --
>  *From:* Jay McCarthy 
> *To:* J Arcane 
> *Cc:* Racket Users ; Robby Findler <
> ro...@eecs.northwestern.edu>; Marc Burns 
> *Sent:* Monday, September 22, 2014 12:05 PM
> *Subject:* Re: [racket] Hosting the try-racket REPL.
>
> J and I chatted a little and he got his DNS working and also I added
>
> http://try.racket-lang.org/
>
> as an alias for it.
>
> In general, the Racket team is willing to give out subdomains of
> r-l.org for projects that would like them, so they don't have to buy
> their own DNS addresses. Just email the list or one of us directly to
> ask.
>
> Jay
>
> On Mon, Sep 22, 2014 at 1:17 AM, J Arcane  wrote:
> > Hmm.
> >
> > Alright, replacing the calls to slideshow with calls directly to pict, as
> > well as commenting out the racket/gui/base calls successfully gets the
> code
> > to run without X.
> >
> > However, something about how it converts the picts for web isn't
> working, so
> > instead of a neat little circle, for instance, I get "(pict '(prog
> > # >
> > I suspect this is probably something to do with a difference in behavior
> in
> > how images are converted by the server, which does a convertible? test
> and
> > then runs:
> >  (run-code ev `(bytes-append #"data:image/png;base64,"
> >  (base64-encode (convert ,res 'png-bytes) #"")))
> >
> > At an idiot's guess, something is different about how pict is making the
> > images, so convertible? is #f and the code just prints the (pict
> '(prog...
> > stuff.
> >
> > I've set up a fork here: https://github.com/jarcane/try-racket
> > I'm still working on getting the DNS set properly though, so no
> > try-racket.org yet; the servlet is public at http://104.131.18.192:8000/
> but
> > I haven't figured out how to get try-racket.org to go there yet.
> >
> >
> >  wrote:
> >>
> >> Maybe you can use  slideshow/code-pict instead?
> >>
> >> Robby
> >>
> >> On Sun, Sep 21, 2014 at 6:00 PM, Marc Burns <
> m4bu...@csclub.uwaterloo.ca>
> >> wrote:
> >> > The culprit is the slideshow/code module loaded into the sandbox
> >> > evaluator. Requiring slideshow/code attempts to establish an X server
> >> > connection.
> >> >
> >> > On Mon, Sep 22, 2014 at 12:12:37AM +0300, J Arcane wrote:
> >> >> Greetings,
> >> >>
> >> >> For some time now, it's bothered me a bit that Racket doesn't have an
> >> >> online REPL currently hosted anywhere. There's one written here:
> >> >> https://github.com/voila/try-racket
> >> >>
> >> >> But no one's hosted it anywhere. So I took it upon myself to fix
> that.
> >> >> I've
> >> >> purchased try-racket.org and a basic DigitalOcean droplet to host it
> >> >> on,
> >> >> but I've hit a snag: I can't get it to run.
> >> >>
> >> >> It runs more or less without trouble on my personal FreeBSD box, but
> on
> >> >> my
> >> >> Debian 7 droplet I waded through countless dependency issues until
> >> >> finally
> >> >> I reached what seems to be this same error:
> >> >>
> >> >> http://bugs.racket-lang.org/query/?cmd=view%20audit-trail≺=12465
> <http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&pr=12465>
>
> >> >>
> >> >> Presuming that perhaps this was in someway trying to run Racket in an
> >> >> actual GUI window whether I wanted it to or not, I attempted to run
> it
> >> >> as
> >> >> --script, but this just quits silently instead, leaving no servlet
> >> >> behind
> >> >> either.
> >> >>
> >> >> Any ideas what I might be doing wrong? or have I hit a proper bug?
> (IME
> >> >> it's usually the former ... )
> >> >>
> >> >> John Berry
> >> >> http://jarcane.github.com
> >> >
> >> >> 
> >> >>  Racket Users list:
> >> >>  http://lists.racket-lang.org/users
> >> >
> >> > 
> >> >  Racket Users list:
> >> >  http://lists.racket-lang.org/users
> >
> >
> >
> > 
> >  Racket Users list:
> >  http://lists.racket-lang.org/users
> >
>
>
>
> --
> Jay McCarthy
> http://jeapostrophe.github.io
>
>   "Wherefore, be not weary in well-doing,
>   for ye are laying the foundation of a great work.
> And out of small things proceedeth that which is great."
>   - D&C 64:33
>
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
>
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Hosting the try-racket REPL.

2014-09-22 Thread J Arcane
That does sound an awful headache for something that otherwise doesn't seem
to be using X for anything other than dependency expectations. It seems
like there should be a non-X-dependent way to do it.

On Mon, Sep 22, 2014 at 9:52 AM, Neil Van Dyke  wrote:

> Amir Ansari wrote at 09/22/2014 02:28 AM:
>
>> Have you tried Xvfb (http://en.wikipedia.org/wiki/Xvfb), a virtual X
>> server? It runs headlessly, sidesteps the whole issue of having to fork the
>> code...
>>
>>
> I have no idea whether "xvfb" is the best way without looking closely at a
> particular case, but I've seen "xvfb" work in the past on production
> servers.  (Not for Racket, but for some R statistics tool that touched the
> X server, so that the tool could be used off-the-shelf, rather than
> maintaining a modified fork of the tool source.)
>
> If you do this, just be write your startup and shutdown scripts to be
> resilient and stable (e.g., wrt available ports/sockets at the time, and to
> shut down cleanly, and so there are no race conditions or conflicts between
> multiple simultaneous users), and secure (e.g., ensure that it won't
> accidentally listen on a public network interface, and that an attacker
> can't synthesize operations to the xvfb to escalate privileges or DoS, and
> that the xvfb can't be used to leak data between users).
>
> Neil V.
>
>
> 
>  Racket Users list:
>  http://lists.racket-lang.org/users
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Hosting the try-racket REPL.

2014-09-21 Thread J Arcane
I had not actually heard of Xvfb before now, but that could be a good
solution. I balk at using full X11 with only 512MB of RAM, but that could
be enough to satisfy the original code's expectations. I will have to
experiment with it.

On Mon, Sep 22, 2014 at 9:28 AM, Amir Ansari  wrote:

> Have you tried Xvfb (http://en.wikipedia.org/wiki/Xvfb), a virtual X
> server? It runs headlessly, sidesteps the whole issue of having to fork the
> code...
>
> Amir
> 
>   Racket Users list:
>   http://lists.racket-lang.org/users
>

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Hosting the try-racket REPL.

2014-09-21 Thread J Arcane
Hmm.

Alright, replacing the calls to slideshow with calls directly to pict, as
well as commenting out the racket/gui/base calls successfully gets the code
to run without X.

However, something about how it converts the picts for web isn't working,
so instead of a neat little circle, for instance, I get "(pict '(prog
#https://github.com/jarcane/try-racket
I'm still working on getting the DNS set properly though, so no
try-racket.org yet; the servlet is public at http://104.131.18.192:8000/
but I haven't figured out how to get try-racket.org to go there yet.


 wrote:

> Maybe you can use  slideshow/code-pict instead?
>
> Robby
>
> On Sun, Sep 21, 2014 at 6:00 PM, Marc Burns 
> wrote:
> > The culprit is the slideshow/code module loaded into the sandbox
> > evaluator. Requiring slideshow/code attempts to establish an X server
> > connection.
> >
> > On Mon, Sep 22, 2014 at 12:12:37AM +0300, J Arcane wrote:
> >> Greetings,
> >>
> >> For some time now, it's bothered me a bit that Racket doesn't have an
> >> online REPL currently hosted anywhere. There's one written here:
> >> https://github.com/voila/try-racket
> >>
> >> But no one's hosted it anywhere. So I took it upon myself to fix that.
> I've
> >> purchased try-racket.org and a basic DigitalOcean droplet to host it
> on,
> >> but I've hit a snag: I can't get it to run.
> >>
> >> It runs more or less without trouble on my personal FreeBSD box, but on
> my
> >> Debian 7 droplet I waded through countless dependency issues until
> finally
> >> I reached what seems to be this same error:
> >>
> >> http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&pr=12465
> >>
> >> Presuming that perhaps this was in someway trying to run Racket in an
> >> actual GUI window whether I wanted it to or not, I attempted to run it
> as
> >> --script, but this just quits silently instead, leaving no servlet
> behind
> >> either.
> >>
> >> Any ideas what I might be doing wrong? or have I hit a proper bug? (IME
> >> it's usually the former ... )
> >>
> >> John Berry
> >> http://jarcane.github.com
> >
> >> 
> >>   Racket Users list:
> >>   http://lists.racket-lang.org/users
> >
> > 
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
>

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Hosting the try-racket REPL.

2014-09-21 Thread J Arcane
Greetings,

For some time now, it's bothered me a bit that Racket doesn't have an
online REPL currently hosted anywhere. There's one written here:
https://github.com/voila/try-racket

But no one's hosted it anywhere. So I took it upon myself to fix that. I've
purchased try-racket.org and a basic DigitalOcean droplet to host it on,
but I've hit a snag: I can't get it to run.

It runs more or less without trouble on my personal FreeBSD box, but on my
Debian 7 droplet I waded through countless dependency issues until finally
I reached what seems to be this same error:

http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&pr=12465

Presuming that perhaps this was in someway trying to run Racket in an
actual GUI window whether I wanted it to or not, I attempted to run it as
--script, but this just quits silently instead, leaving no servlet behind
either.

Any ideas what I might be doing wrong? or have I hit a proper bug? (IME
it's usually the former ... )

John Berry
http://jarcane.github.com

  Racket Users list:
  http://lists.racket-lang.org/users


Re: [racket] Keyboard polling and user packages

2014-08-10 Thread J Arcane
Well, thanks to CharTerm, I have made it work. However, in adding some
error handling routines for the runtime I've run into a weird bug.

You can see the full code here:
https://github.com/jarcane/MicroMini/blob/master/main.rkt

The relevant bit, however, is the (crash-handler) function. For some reason
that utterly escapes my notice or discovery, the (format "~X" ...) call
there does not actually spit out a hexadecimal number at runtime.

The weirdest part is: I can't repeat the bug anywhere but when actually
running main.rkt. I've even tried hand-entering all the relevant bits into
the commandline REPL and calling the crash-handler inside a
(with-crashterm), and it doesn't do it there: It properly gives me a
hexadecimal number.

Other than that it works great so far. Now I need to write at least a basic
assembler.


On Sun, Aug 10, 2014 at 6:09 PM, Neil Van Dyke  wrote:

> If you haven't already, you can try the following to disable any port
> buffering within Racket, but that doesn't help you if the OS (Windows and
> Posix-ish console stuff it's doing from the console window) isn't giving
> Racket raw, unbuffered access to keyboard input through stdin:
>
> (file-stream-buffer-mode my-port 'none)
>
> If you were using almost anything other than Windows, you could just use "
> http://www.neilvandyke.org/racket-charterm/";.
>
> Other than that, you or someone could make a portable Racket text-terminal
> package that does stuff like uses the console API on Windows and tty on
> almost everything else.
>
> BTW, you mention getting random bytes with variations on "read-bytes".
>  That simply shouldn't happen with "read-bytes", but, when using variations
> on "read-bytes-avail!", only the first N count bytes it says it read will
> be valid in the bytestring.
>
> Neil V.
>
>

  Racket Users list:
  http://lists.racket-lang.org/users


[racket] Keyboard polling and user packages

2014-08-10 Thread J Arcane
Hello,

I've been working on a learning project, a simple 8-bit virtual stack
machine, (code so far is here:
https://github.com/jarcane/MicroMini/blob/master/main.rkt) and I've run
into a bit of a snag when it comes to getting input.

I'm trying to set up basic character terminal I/O.  The spec I've written
defines two instructions:

TRMO, which pops the byte at the top of the stack to the terminal bus line
(currently emulated in Racket with a simple (write-byte (pop)))

TRMI, which polls the terminal bus line for a key press and pushes the
resulting byte to the stack.

I can't for the life of me figure out how to do this. I've been reading
docs for hours, exhausting my google fu, and attempting any number of
failed experiments involving the built-ins, and I've got nothing.

The various incantations of (read-bytes) seem to produce finicky and
unpredictable results, either spitting out random values or else taking
input in the form of a \n terminated prompt. This is kind of unoptimal when
all I need is a single-byte.

I've looked at various libraries and bits of sample code, but all the
command-line solutions are Unix specific (requiring stty), and everything
else involves building a GUI (which wasn't really the intent, I was meaning
to keep it as a simple CL app I could feed binary files to).

I also ran into problems with installing libraries anyway, because unless I
just called them from Planet, they install to user-scope by default, and I
have no clue at all where user packages go on Windows or how to (require)
them.

Is there seriously no crossplatform, non-GUI means of polling a key event
for Racket?

Getting frustrated,
John

  Racket Users list:
  http://lists.racket-lang.org/users