Re: [racket-users] Seeking a graphviz like, diagramming language for Racket

2017-08-19 Thread WarGrey Gyoudmon Ju
On Sun, Aug 20, 2017 at 1:20 AM, Andrew Gwozdziewycz 
wrote:

> Are you focused more on replacing Graphviz, or a generalized drawing
> and visualization library that could be used to more easily put
> together a Graphviz like tool? I guess they are likely somewhat
> similar goals...


Firstly, I just write it for fun, but also focus on high quality real world
applications
since I do not want to use any software design tools that force me dragging
and clicking.

In untyped racket (but may not in the main distribution), there are a lot
of small packages
that focus on one or more subfields of graph visualization and layout
algorithms. In typed
racket, there also are pict3d, plot, and flomap based images. So I think
they definitely benefit
user-designers and covers lots of everyday usage, but user-developers may
need more
extension abilities since modern applications grow too fast.

Therefore, I am writing a modern design engine for programmers with an
elegant functional interface,
graphviz like tool is one of the applications of this engine, actually it
is likely to be the first one.

For now,
* CSS syntax and its computation model is chosen to style elements and
items;
* New architecture and datatypes is coming soon for
reading/composing/writing image resources.

Also I am glad to write the entire tex system in native Typed Racket,
though it is really a huge
project and therefore a long term plan.

-- 
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] Seeking a graphviz like, diagramming language for Racket

2017-08-19 Thread Robby Findler
There are a few tree layout algorithms implemented in
pict/tree-layout: http://docs.racket-lang.org/pict/Tree_Layout.html

Robby


On Sat, Aug 19, 2017 at 4:13 PM, Daniel Prager
 wrote:
> Hi Andrew
>
> I did commercial work on mind-map like tools in the 2000's, and have a soft
> spot for graph and tree visualisation.
>
> Example:
> https://www.researchgate.net/figure/221249211_fig1_Fig-1-Example-hi-tree-laid-out-in-the-standard-layout-style-It-shows-the-logical
>
> I didn't work on the deep layout algorithms, but have some handy peripheral
> knowledge.There's a tension between the manual effort of the interactive
> tools and more automated layout algorithms. In my ideal world the
> auto-layout does most of the heavy lifting, but the layout doesn't jump
> around too much in interactive work, and the user can easily play with
> styles, aesthetic criteria, and nudge the layout to some extent. It's not
> easy to get all at once!
>
> In practice, I tend to settle for GraphViz for my occasional
> graph-diagramming needs, but would welcome a Rackety competitor. My sense is
> that it may be feasible to do better for specific needs, and challenging to
> beat GraphViz as a general purpose tool.
>
> Here's a nice introduction to the evolution of tree-layout algorithms,
> explaining how aesthetic criteria were gradually captured in a series of
> principles for layout algorithms to satisfy:
>
> Principle 1: The edges of the tree should not cross each other.
>
> Principle 2: All nodes at the same depth should be drawn on the same
> horizontal line. This helps make clear the structure of the tree.
>
> Principle 3: Trees should be drawn as narrowly as possible.
>
> Principle 4: A parent should be centered over its children.
>
> Principle 5: A subtree should be drawn the same no matter where in the tree
> it lies.
>
> Principle 6: The child nodes of a parent node should be evenly spaced.
>
> The author of the first reference, Kim Marriott, is an active academic in
> the area of constraint-based graph and tree layout. I collaborated with him
> and his student Peter Sbarski on the above-mentioned commercial work. Kim's
> a good source.
>
> Dan
>
> --
> 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] Seeking a graphviz like, diagramming language for Racket

2017-08-19 Thread Daniel Prager
Hi Andrew

I did commercial work on mind-map like tools in the 2000's, and have a soft
spot for graph and tree visualisation.

Example: https://www.researchgate.net/figure/221249211_fig1_Fig-1-
Example-hi-tree-laid-out-in-the-standard-layout-style-It-shows-the-logical

I didn't work on the deep layout algorithms, but have some handy peripheral
knowledge.There's a tension between the manual effort of the interactive
tools and more automated layout algorithms. In my ideal world the
auto-layout does most of the heavy lifting, but the layout doesn't jump
around too much in interactive work, and the user can easily play with
styles, aesthetic criteria, and nudge the layout to some extent. It's not
easy to get all at once!

In practice, I tend to settle for GraphViz for my occasional
graph-diagramming needs, but would welcome a Rackety competitor. My sense
is that it may be feasible to do better for specific needs, and challenging
to beat GraphViz as a general purpose tool.

Here's a nice introduction to the evolution of tree-layout algorithms
, explaining how aesthetic
criteria were gradually captured in a series of principles for layout
algorithms to satisfy:

*Principle 1*: *The edges of the tree should not cross each other.*

*Principle 2*:
*All nodes at the same depth should be drawn on the same horizontal line.
This helps make clear the structure of the tree.*

*Principle 3*: *Trees should be drawn as narrowly as possible.*

*Principle 4*: *A parent should be centered over its children.*

*Principle 5*: *A subtree should be drawn the same no matter where in the
tree it lies.*

*Principle 6*: *The child nodes of a parent node should be evenly spaced.*
The author of the first reference, Kim Marriott, is an active academic in
the area of constraint-based graph and tree layout. I collaborated with him
and his student Peter Sbarski on the above-mentioned commercial work. Kim's
a good source.

Dan

-- 
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] Seeking a graphviz like, diagramming language for Racket

2017-08-19 Thread Andrew Gwozdziewycz
On Sat, Aug 19, 2017 at 7:19 AM, Jens Axel Søgaard
 wrote:
> 2017-08-18 12:10 GMT+02:00 Andrew Gwozdziewycz :
>>
>> Hi folks,
>>
>> I've been using graphviz for years for basic network architecture
>> diagrams and things, mostly to avoid answering the question of "which
>> annoying tool should I use?" Graphviz has limitations for the type of
>> stuff I use it for, but I settle for it anyway, since it's a lot less
>> frustrating to use a language for laying out relationships than
>> clicking and dragging lines connecting things, in an agreed upon
>> diagramming tool.
>>
>> Has anyone started work (or finished work, or even somewhere in
>> between?) on a diagramming language that might be, or even eventually
>> will be a suitable replacement for performing these types of tasks?
>>
>> And if not, does anyone have suggestions for getting started with
>> layout drawing algorithms suitable for such a thing? I'm fairly sure
>> that the pict language will do the heavy lifting work for actually
>> drawing on a canvas, and simple layout techniques probably would go
>> along way, but getting to know the field a bit might be useful...
>
>
> Maybe you can find something useful in MetaPict?
>
> http://soegaard.github.io/docs/metapict/metapict.html

I think there's definitely a lot of interesting pieces to MetaPict
that will help! And, if it doesn't help directly with these efforts,
it'll at least be fun to play with!

>
> As for algorithms, this module contains references to interesting tree
> drawing algorithms:
>
> https://github.com/soegaard/metapict/blob/master/metapict/tree.rkt

Great!

Thanks!


-- 
http://www.apgwoz.com

-- 
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] Seeking a graphviz like, diagramming language for Racket

2017-08-19 Thread Andrew Gwozdziewycz
On Sat, Aug 19, 2017 at 7:10 AM, David Storrs  wrote:
> It sounds like an interesting and useful project.  What would you want this
> solution to do, exactly?

The last public hack job I did using graphviz is something like this:

https://heroku-blog-files.s3.amazonaws.com/posts/1488278436-new-architecture.png

As you can see, it gets the point across, but it's not ideal from a
visualization stand point. From a creation standpoint it's great! You
basically declare the relationships, and a drawing comes out.

https://gist.github.com/apg/8c3c8b0bed910faa272aa9e8d6b4f718

My goal is probably somewhere in between in terms of layout. I want a
bit more flexibility, but a decent amount of help with layout. And, I
want a lot more flexibility, and a nice set of primitives for the
actual nodes themselves.

Jens' metapict, and pict itself probably provide enough to take a
serious stab at recreating that diagram more manually, and seeing
where it falls flat, so I'll try that as an exercise next week and
report back.

> On Fri, Aug 18, 2017 at 6:10 AM, Andrew Gwozdziewycz 
> wrote:
>>
>> Hi folks,
>>
>> I've been using graphviz for years for basic network architecture
>> diagrams and things, mostly to avoid answering the question of "which
>> annoying tool should I use?" Graphviz has limitations for the type of
>> stuff I use it for, but I settle for it anyway, since it's a lot less
>> frustrating to use a language for laying out relationships than
>> clicking and dragging lines connecting things, in an agreed upon
>> diagramming tool.
>>
>> Has anyone started work (or finished work, or even somewhere in
>> between?) on a diagramming language that might be, or even eventually
>> will be a suitable replacement for performing these types of tasks?
>>
>> And if not, does anyone have suggestions for getting started with
>> layout drawing algorithms suitable for such a thing? I'm fairly sure
>> that the pict language will do the heavy lifting work for actually
>> drawing on a canvas, and simple layout techniques probably would go
>> along way, but getting to know the field a bit might be useful...
>>
>> Cheers,
>>
>> Andrew
>> --
>> http://www.apgwoz.com
>>
>> --
>> 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.
>
>



-- 
http://www.apgwoz.com

-- 
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] Seeking a graphviz like, diagramming language for Racket

2017-08-19 Thread Andrew Gwozdziewycz
On Sat, Aug 19, 2017 at 6:21 AM, WarGrey Gyoudmon Ju
 wrote:
> I have been working on it, but at very beginning stage and no working code
> right now.

Are you focused more on replacing Graphviz, or a generalized drawing
and visualization library that could be used to more easily put
together a Graphviz like tool? I guess they are likely somewhat
similar goals...

> The official website of Graphviz  provides lots of papers on the underlying
> algorithms,
> I also found Handbook of Graph Drawing and Visualization is worth reading.

The Handbook of Graph Drawing and Visualization looks really great!
Thanks for the recommendation!


> On Fri, Aug 18, 2017 at 6:10 PM, Andrew Gwozdziewycz 
> wrote:
>>
>> Hi folks,
>>
>> I've been using graphviz for years for basic network architecture
>> diagrams and things, mostly to avoid answering the question of "which
>> annoying tool should I use?" Graphviz has limitations for the type of
>> stuff I use it for, but I settle for it anyway, since it's a lot less
>> frustrating to use a language for laying out relationships than
>> clicking and dragging lines connecting things, in an agreed upon
>> diagramming tool.
>>
>> Has anyone started work (or finished work, or even somewhere in
>> between?) on a diagramming language that might be, or even eventually
>> will be a suitable replacement for performing these types of tasks?
>>
>> And if not, does anyone have suggestions for getting started with
>> layout drawing algorithms suitable for such a thing? I'm fairly sure
>> that the pict language will do the heavy lifting work for actually
>> drawing on a canvas, and simple layout techniques probably would go
>> along way, but getting to know the field a bit might be useful...
>>
>> Cheers,
>>
>> Andrew
>> --
>> http://www.apgwoz.com
>>
>> --
>> 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.
>
>



-- 
http://www.apgwoz.com

-- 
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.


[racket-users] Re: Need help with parallelizing a procedure

2017-08-19 Thread George Neuner
On Sat, 19 Aug 2017 10:36:37 -0400, Matthias Felleisen
 wrote:

>
>May I recommend The Seasoned Schemer? 
>

You may certainly.  Ironically, that is one book on Scheme that I have
never read.  

My point to Zelphir was that continuations per se are not unique to
Scheme ... only the ways in which they are exposed to the programmer.

George

-- 
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.


[racket-users] Re: Need help with parallelizing a procedure

2017-08-19 Thread George Neuner
On Sat, 19 Aug 2017 09:28:49 -0400, George Neuner
 wrote:


>When you say, (let/ec foo ... ) , all that's happening is the compiler 
>defines a pseudo-function named 'foo' that when called will exit from 
>the block of code in the scope of the let.  (call/cc foo ...) does the 
>same, but assumes you will be immediately calling a function instead of 
>executing inline code.  Invoking foo anywhere in the function (or its 
>descendants) will jump back out of the call chain.  Scheme makes 
>invoking the continuation look like a function call even though it 
>really is a jump that won't return.

Need to clarify that a bit because makes continuations sound a bit too
much like exceptions.  Code that invokes a continuation has to have a
reference to the continuation's (pseudo)function ...  in contrast any
code can raise a generic exception.

George

-- 
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] Need help with parallelizing a procedure

2017-08-19 Thread Matthias Felleisen

May I recommend The Seasoned Schemer? 


> On Aug 19, 2017, at 9:28 AM, George Neuner  wrote:
> 
> 
> On 8/19/2017 6:16 AM, Zelphir Kaltstahl wrote:
>> I looked at the code for a while again and think I now begin to understand 
>> it a bit more:
>> 
>> I did not know `(let/ec` so I had to read about it. It says, that it is 
>> equivalent to `(call/ec proc` or something, which is equivalent to 
>> `(call-with-escape-continuation ...`. Uff … I don't know much about 
>> continuations, except from a vague idea of when they are called. The idea 
>> gets mingled with structures in other programming languages which are 
>> "catching exceptions" and such stuff. I don't know this stuff, so I guess 
>> `(call-with-escape-continuation` works like catching an exception, which is 
>> not really an exception, but just a signal, that code is returning. Then 
>> instead of simply returning, the escape continuation is called. This is done 
>> implicitly without specifying a named exception for returning and without 
>> defining some conditional structure on the side where it would return to.
>> 
>> This could all be wrong ...
> 
> It's at least a misconception.  Continuations are not exceptions - they are a 
> much lower level construct.  Exception handling is built on top of 
> continuations. 
> 
> There is nothing magic or mysterious about a continuation.  In Scheme, 
> continuations are the moral equivalent of GOTO with arguments [yes, you can 
> pass arguments to continuations].  In actual fact they can be used to write 
> code that jumps around arbitrarily ... but the standard uses are more 
> structured.  
> 
> When you say, (let/ec foo ... ) , all that's happening is the compiler 
> defines a pseudo-function named 'foo' that when called will exit from the 
> block of code in the scope of the let.  (call/cc foo  ...) does the same, but 
> assumes you will be immediately calling a function instead of executing 
> inline code.  Invoking foo anywhere in the function (or its descendants) will 
> jump back out of the call chain.  Scheme makes invoking the continuation look 
> like a function call even though it really is a jump that won't return.
> 
> You do need to learn about continuations because they are the underlying 
> basis of many programming techniques: exceptions, co-routines, threads, etc.  
> ... all of which can be implemented directly in Scheme without dipping into 
> assembler. 
>  
> Dan Friedman's paper is great, but is too technical and too Scheme-centric 
> for beginners.  The Wikipedia article on continuations 
> (https://en.wikipedia.org/wiki/Continuation 
> ) is simpler to understand.  Be 
> sure to look through the "further reading" and links at the end.  But the way 
> to really get a handle on what continuations are is to read a book on 
> compilers - at which point you'll realize that they really are little more 
> than a branch target.
> 
>> However, with this kind of idea about escape continuations in mind, I think 
>> I get the idea behind using `(let/ec` in the code. When a place wants to 
>> exit, it is stopped from doing so, giving it more work, as if to say: "Hey 
>> wait! You can escape, but only if you do THIS! (escape continuation)" Then 
>> the place, desperately wanting to escape thinks: "Damn, OK, I'll do just 
>> that little bit of code more.", not realizing, that it is stuck in a loop. 
>> How mean.
>> 
>> I wonder however, if there is no simpler way of doing this.
>> 
>> I mean, if `(place-channel-get ...)` blocks, could I simply put stuff into 
>> an endless loop without escape continuation and only break the loop, if a 
>> certain symbol is received on the channel?
> 
> How are you going to "break out" of the loop?  In Scheme there are only 3 
> ways to jump over or out of a block of code: return from a function, invoke a 
> continuation, or raise an exception.  The loop I wrote was in the middle of 
> the function where returning was not an option and there was no reason to 
> raise an exception.  Delimited (aka "escape") continuations are a structured 
> way to jump out of a loop.
> 
> A 'do' loop is a macro that hides continuations inside.  You might as well 
> learn to use them directly.
> 
>> Since `(place-channel-get ...)` is blocking, it should not generate any CPU 
>> load, when there is no message on the channel (right?).
>> 
>> Why do I need to introduce something as complex as `(let/ec ...)`?
> 
> Because you need to exit from of the - otherwise infinite - loop.  
> 
>> I appreciate the code shared here. I just hesitate to use it, when I don't 
>> even understand it myself or when I am super unsure about understanding it 
>> (escape continuations). I am also thinking about how I can replace all the 
>> exclamation mark procedures, before adding it to my other code, which does 
>> not deal with assignments so far.
> 
> Don't get too hung up on style points ... the goal is to write code that is 
> easy 

Re: [racket-users] Seeking a graphviz like, diagramming language for Racket

2017-08-19 Thread Jens Axel Søgaard
2017-08-18 12:10 GMT+02:00 Andrew Gwozdziewycz :

> Hi folks,
>
> I've been using graphviz for years for basic network architecture
> diagrams and things, mostly to avoid answering the question of "which
> annoying tool should I use?" Graphviz has limitations for the type of
> stuff I use it for, but I settle for it anyway, since it's a lot less
> frustrating to use a language for laying out relationships than
> clicking and dragging lines connecting things, in an agreed upon
> diagramming tool.
>
> Has anyone started work (or finished work, or even somewhere in
> between?) on a diagramming language that might be, or even eventually
> will be a suitable replacement for performing these types of tasks?
>
> And if not, does anyone have suggestions for getting started with
> layout drawing algorithms suitable for such a thing? I'm fairly sure
> that the pict language will do the heavy lifting work for actually
> drawing on a canvas, and simple layout techniques probably would go
> along way, but getting to know the field a bit might be useful...
>

Maybe you can find something useful in MetaPict?

http://soegaard.github.io/docs/metapict/metapict.html

As for algorithms, this module contains references to interesting tree
drawing algorithms:

https://github.com/soegaard/metapict/blob/master/metapict/tree.rkt


/Jens Axel

-- 
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: Need help with parallelizing a procedure

2017-08-19 Thread George Neuner


On 8/19/2017 6:16 AM, Zelphir Kaltstahl wrote:

I looked at the code for a while again and think I now begin to understand it a 
bit more:

I did not know `(let/ec` so I had to read about it. It says, that it is equivalent to 
`(call/ec proc` or something, which is equivalent to `(call-with-escape-continuation 
...`. Uff … I don't know much about continuations, except from a vague idea of when they 
are called. The idea gets mingled with structures in other programming languages which 
are "catching exceptions" and such stuff. I don't know this stuff, so I guess 
`(call-with-escape-continuation` works like catching an exception, which is not really an 
exception, but just a signal, that code is returning. Then instead of simply returning, 
the escape continuation is called. This is done implicitly without specifying a named 
exception for returning and without defining some conditional structure on the side where 
it would return to.

This could all be wrong ...


It's at least a misconception.  Continuations are _not_ exceptions - 
they are a much lower level construct.  Exception handling is built on 
top of continuations.


There is nothing magic or mysterious about a continuation.  In Scheme, 
continuations are the moral equivalent of GOTO with arguments [yes, you 
can pass arguments to continuations].  In actual fact they can be used 
to write code that jumps around arbitrarily ... but the standard uses 
are more structured.


When you say, (let/ec foo ... ) , all that's happening is the compiler 
defines a pseudo-function named 'foo' that when called will exit from 
the block of code in the scope of the let.  (call/cc foo ...) does the 
same, but assumes you will be immediately calling a function instead of 
executing inline code.  Invoking foo anywhere in the function (or its 
descendants) will jump back out of the call chain.  Scheme makes 
invoking the continuation look like a function call even though it 
really is a jump that won't return.


You do need to learn about continuations because they are the underlying 
basis of many programming techniques: exceptions, co-routines, threads, 
etc.  ... all of which can be implemented directly in Scheme without 
dipping into assembler.


Dan Friedman's paper is great, but is too technical and too 
Scheme-centric for beginners.  The Wikipedia article on continuations 
(https://en.wikipedia.org/wiki/Continuation) is simpler to understand.  
Be sure to look through the "further reading" and links at the end.  But 
the way to really get a handle on what continuations are is to read a 
book on compilers - at which point you'll realize that they really are 
little more than a branch target.



However, with this kind of idea about escape continuations in mind, I think I get the idea behind 
using `(let/ec` in the code. When a place wants to exit, it is stopped from doing so, giving it 
more work, as if to say: "Hey wait! You can escape, but only if you do THIS! (escape 
continuation)" Then the place, desperately wanting to escape thinks: "Damn, OK, I'll do 
just that little bit of code more.", not realizing, that it is stuck in a loop. How mean.

I wonder however, if there is no simpler way of doing this.

I mean, if `(place-channel-get ...)` blocks, could I simply put stuff into an 
endless loop without escape continuation and only break the loop, if a certain 
symbol is received on the channel?


How are you going to "break out" of the loop?  In Scheme there are only 
3 ways to jump over or out of a block of code: return from a function, 
invoke a continuation, or raise an exception.  The loop I wrote was in 
the middle of the function where returning was not an option and there 
was no reason to raise an exception.  Delimited (aka "escape") 
continuations are a structured way to jump out of a loop.


A 'do' loop is a macro that hides continuations inside.  You might as 
well learn to use them directly.



Since `(place-channel-get ...)` is blocking, it should not generate any CPU 
load, when there is no message on the channel (right?).

Why do I need to introduce something as complex as `(let/ec ...)`?


Because you need to exit from of the - otherwise infinite - loop.


I appreciate the code shared here. I just hesitate to use it, when I don't even 
understand it myself or when I am super unsure about understanding it (escape 
continuations). I am also thinking about how I can replace all the exclamation 
mark procedures, before adding it to my other code, which does not deal with 
assignments so far.


Don't get too hung up on style points ... the goal is to write code that 
is easy to read and that you [and others] will understand without 
needing days of intensive study.  If avoiding assignments makes your 
code longer and more convoluted, then doing it was a bad thing.



Is there some easy to understand introduction to continuations in Racket? (not 
a super clever and scientific Friedman paper, which I'd probably need 1 year to 
actually 

Re: [racket-users] Seeking a graphviz like, diagramming language for Racket

2017-08-19 Thread WarGrey Gyoudmon Ju
I have been working on it, but at very beginning stage and no working code
right now.

The official website of Graphviz  provides lots of papers on the underlying
algorithms,
I also found *Handbook of Graph Drawing and Visualization *is worth reading.

On Fri, Aug 18, 2017 at 6:10 PM, Andrew Gwozdziewycz 
wrote:

> Hi folks,
>
> I've been using graphviz for years for basic network architecture
> diagrams and things, mostly to avoid answering the question of "which
> annoying tool should I use?" Graphviz has limitations for the type of
> stuff I use it for, but I settle for it anyway, since it's a lot less
> frustrating to use a language for laying out relationships than
> clicking and dragging lines connecting things, in an agreed upon
> diagramming tool.
>
> Has anyone started work (or finished work, or even somewhere in
> between?) on a diagramming language that might be, or even eventually
> will be a suitable replacement for performing these types of tasks?
>
> And if not, does anyone have suggestions for getting started with
> layout drawing algorithms suitable for such a thing? I'm fairly sure
> that the pict language will do the heavy lifting work for actually
> drawing on a canvas, and simple layout techniques probably would go
> along way, but getting to know the field a bit might be useful...
>
> Cheers,
>
> Andrew
> --
> http://www.apgwoz.com
>
> --
> 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.


[racket-users] Re: Need help with parallelizing a procedure

2017-08-19 Thread Greg Trzeciak
On Saturday, August 19, 2017 at 12:16:53 PM UTC+2, Zelphir Kaltstahl wrote:
> 
> Is there some easy to understand introduction to continuations in Racket? 
> (not a super clever and scientific Friedman paper, which I'd probably need 1 
> year to actually understand :D)

Try with Beautiful Racket short introduction first:
http://beautifulracket.com/explainer/continuations.html

-- 
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.


[racket-users] Re: Need help with parallelizing a procedure

2017-08-19 Thread Zelphir Kaltstahl
I looked at the code for a while again and think I now begin to understand it a 
bit more:

I did not know `(let/ec` so I had to read about it. It says, that it is 
equivalent to `(call/ec proc` or something, which is equivalent to 
`(call-with-escape-continuation ...`. Uff … I don't know much about 
continuations, except from a vague idea of when they are called. The idea gets 
mingled with structures in other programming languages which are "catching 
exceptions" and such stuff. I don't know this stuff, so I guess 
`(call-with-escape-continuation` works like catching an exception, which is not 
really an exception, but just a signal, that code is returning. Then instead of 
simply returning, the escape continuation is called. This is done implicitly 
without specifying a named exception for returning and without defining some 
conditional structure on the side where it would return to.

This could all be wrong and all I found was the following very unhelpful 
https://lists.racket-lang.org/users/archive/2010-October/042356.html where it 
links me to some paper (https://www.cs.indiana.edu/~dfried/appcont.pdf), which 
I have no motivation to read in its entirety, even if it's probably really 
clever stuff. Maybe that is the actual reason: Fearing that I wont understand 
any of it in depth. It also includes some exercises, which seem to be really 
difficult.

However, with this kind of idea about escape continuations in mind, I think I 
get the idea behind using `(let/ec` in the code. When a place wants to exit, it 
is stopped from doing so, giving it more work, as if to say: "Hey wait! You can 
escape, but only if you do THIS! (escape continuation)" Then the place, 
desperately wanting to escape thinks: "Damn, OK, I'll do just that little bit 
of code more.", not realizing, that it is stuck in a loop. How mean.

I wonder however, if there is no simpler way of doing this.

I mean, if `(place-channel-get ...)` blocks, could I simply put stuff into an 
endless loop without escape continuation and only break the loop, if a certain 
symbol is received on the channel?

Since `(place-channel-get ...)` is blocking, it should not generate any CPU 
load, when there is no message on the channel (right?).

Why do I need to introduce something as complex as `(let/ec ...)`?

I appreciate the code shared here. I just hesitate to use it, when I don't even 
understand it myself or when I am super unsure about understanding it (escape 
continuations). I am also thinking about how I can replace all the exclamation 
mark procedures, before adding it to my other code, which does not deal with 
assignments so far.

Is there some easy to understand introduction to continuations in Racket? (not 
a super clever and scientific Friedman paper, which I'd probably need 1 year to 
actually understand :D)

-- 
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.