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

2017-09-14 Thread Jens Axel Søgaard
Updated MetaPict today in order to fix missing exports from node.rkt.

The following example now produces this picture:

https://imgur.com/a/AYTz7

The parameters to control the shape of the arrow is explained here:

http://www.ntg.nl/maps/36/19.pdf

but the default arrow looks fine.

#lang racket
(require metapict)

(set-curve-pict-size 400 400)   ; pict size
(curve-pict-window (window -1 3 -1 3))  ; x in [-1;3] and y in [-1;3]

; ah means "arrow head"
(ahangle 45)   ; default head angle 45 degrees
(ahflankangle0); default "curvature" of flank (in degrees)
(ahtailcurvature 0); default "curvature" of the back  todo!
(ahratio 1)
(ahlength(px 6))

; node centers
(define c1 (pt 0 0))
(define c2 (pt 2 0))
(define c3 (pt 0 2))
(define c4 (pt 2 2))

; nodes
(define n1 (circle-node c1 .3))
(define n2 (circle-node c2 .3))
(define n3 (square-node c3 .3))
(define n4 (circle-node c4 .3))

(define (outside n1 v s)
  (define a (anchor n1 v))
  (define n (normal n1 v))
  (pt+ a (vec* s n)))

(define (besides p dir s)
  ; point next to p in the direction dir,
  ; the parameter s determines how far
  (pt+ p (vec* s dir)))

(define (between p1 p2)
  (med 1/2 c1 p2)) ; midpoint

(margin 5
(draw n1 n2 n3 (filled-node n4); the nodes
  (label-bot "AB"  (outside n1 down 0.05)) ; label below node n1
  (label-cnt "42" c1)  ; contents (42) in
the center of node 1
  (draw-edge n1 n2); edge from node n1
to node n2
  (draw-edge n1 n3 west south) ; edge from west
side of n1 to south side of n3
  (draw-edge n1 n4); edge from node n1
to node n4
  ;; label right of
midpoint of nodes 1 and 4
  (label-rt "transition"
(besides (between c1 c4) east 0.1



2017-08-19 16:19 GMT+02:00 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
>
>


-- 
-- 
Jens Axel Søgaard

-- 
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] SWIG

2017-09-14 Thread James
On Sep 14, 2017, at 3:13 PM, Tony Garnock-Jones wrote:

> I have a library for uPNP and NAT-PMP:
> https://github.com/tonyg/racket-nat-traversal. It's not on the package
> server for lack of round tuits, but it might be of interest. Certainly a
> lot nicer not to have to go for an FFI when a Racket library might be
> able to do the job.


Thanks but we really want ICE (STUN and TURN) and not something that configures 
exceptions in firewalls.  Part of the reason is that a lot of people and small 
businesses, rightly, disable these services in their broadband routers for 
security reasons.   The other thing is that we need to be able to work with 
people who have a NAT layer in an institutional setting like a university LAN.  

James

-- 
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] SWIG

2017-09-14 Thread Neil Van Dyke

Tony Garnock-Jones wrote on 09/14/2017 03:13 PM:

Certainly a lot nicer not to have to go for an FFI when a Racket library might 
be able to do the job.


Tony, doing this in pure Racket is great, and an example to the rest of 
us (that one can work through some networking trickiness in pure 
Racket).  Thank you for writing and releasing this.


--
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] SWIG

2017-09-14 Thread Tony Garnock-Jones
I have a library for uPNP and NAT-PMP:
https://github.com/tonyg/racket-nat-traversal. It's not on the package
server for lack of round tuits, but it might be of interest. Certainly a
lot nicer not to have to go for an FFI when a Racket library might be
able to do the job.

Cheers,
  Tony


On 09/14/2017 05:58 PM, James wrote:
> Does anyone here have experience with using SWIG, http://www.swig.org/ , in 
> Racket?  The reason I ask is that I am working on an application which needs 
> NAT traversal.  One option is Libnice, which supports GObject Introspection.  
> Another possibility is PJNATH, http://www.pjsip.org/pjnath/docs/html/ , which 
> can be used by way of SWIG.  This has been done with Python and JAVA.  The 
> link above also mentions that Racket is a supported language for SWIG.  So I 
> would like to get some idea whether we are much more likely to run into 
> problems with immature code and documentation this way than with GObject 
> introspection.
> 
> James
> 

-- 
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] SWIG

2017-09-14 Thread James
Does anyone here have experience with using SWIG, http://www.swig.org/ , in 
Racket?  The reason I ask is that I am working on an application which needs 
NAT traversal.  One option is Libnice, which supports GObject Introspection.  
Another possibility is PJNATH, http://www.pjsip.org/pjnath/docs/html/ , which 
can be used by way of SWIG.  This has been done with Python and JAVA.  The link 
above also mentions that Racket is a supported language for SWIG.  So I would 
like to get some idea whether we are much more likely to run into problems with 
immature code and documentation this way than with GObject introspection.

James

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

2017-09-14 Thread John Greco
For whatever it's worth, the racket package 'graph' can output to graphviz. 
 I'd be excited to see graphviz superseded by a superior diagram DSL though.

On Friday, August 18, 2017 at 3:10:25 AM UTC-7, 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.


[racket-users] Re: Benefits of Racket-on-Chez for laymen

2017-09-14 Thread Gour
On Thu, 14 Sep 2017 05:53:59 -0600
Matthew Flatt  wrote:

> Yes, that's the goal. In the near term, the best-case scenario is that
> existing Racket programs run on Chez Scheme and sometimes run faster
> and/or in less memory.

Wonderful!

> The benefits within Racket's implementation are much greater in the
> near term, since the new Racket layer is more maintainable and
> adaptable, and that layer lives on a Chez Scheme base that is
> certainly better than the part of the Racket that it replaces.

You don't envision 'impedance mismatch' between the two?

> Hopefully, this internal restructuring will allow more people to
> contribute to Racket's implementation, leading to a range of
> improvements for end users in the long run.

Bright future for the Racket...

> Only a few small things, and only recently.

Humble, us usual. ;)


Sincerely,
Gour

-- 
Abandoning all attachment to the results of his activities,
ever satisfied and independent, he performs no fruitive action,
although engaged in all kinds of undertakings.


-- 
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] Benefits of Racket-on-Chez for laymen

2017-09-14 Thread Matthew Flatt
At Wed, 13 Sep 2017 08:29:55 +0200, Gour wrote:
> I'm interested to learn and use Racket for desktop apps and after
> reading about the plan to use Chez Scheme as Racket's VM I wonder
> what are the implications of this step for the end users?
>
> Does Racket-on-Chez mean one will get the best of both worlds, iow.
> have Chez's performance, exectuables, multiple threads support etc.
> while still enjoying Racket's ecosystem - package manager,
> batteries-included, programming environment, excellent docs etc.

Yes, that's the goal. In the near term, the best-case scenario is that
existing Racket programs run on Chez Scheme and sometimes run faster
and/or in less memory.

The benefits within Racket's implementation are much greater in the
near term, since the new Racket layer is more maintainable and
adaptable, and that layer lives on a Chez Scheme base that is certainly
better than the part of the Racket that it replaces. Hopefully, this
internal restructuring will allow more people to contribute to Racket's
implementation, leading to a range of improvements for end users in the
long run.

> Otoh, I see that mflatt does contribute a lot to the Chez...

Only a few small things, and only recently.


Matthew

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