comradesparklepony
2019-11-10 15:36:33

@comradesparklepony has joined the channel


steveh2009
2019-11-10 16:50:14

Belated reply. I’m not questioning how Racket implements its CFFI. I’m questioning why anyone would want to use it directly for a big library of calls when it doesn’t scale. That is, there’s a level of abstraction which, imo, should be written on top of it. For example, given the collected C function prototypes, structs, unions, typedefs, etc., luajit can generate the FFI in seconds. Now, something like libgdiplus on Windows is like 600 functions plus supporting data structures / pointers. Who would want to spend their time to hard-code that to a Racket CFFI when a layer one level up could code generate it in seconds?


steveh2009
2019-11-10 16:53:28

To start, it may be easier to use an antlr C grammar definition to pull in the C declarations and then gen the Racket CFFI.


steveh2009
2019-11-10 17:02:26

Haven’t looked into the luajit source code but, if the FFI slurping part of it is extractable then it just needs the Racket CFFI code gen part.


catherine.c.stwrt
2019-11-10 17:04:00

@catherine.c.stwrt has joined the channel


soegaard2
2019-11-10 17:05:27

soegaard2
2019-11-10 17:10:29

steveh2009
2019-11-10 17:17:23

Thanks, 2nd one looks good. It would be ideal to have it all coded in Racket.


steveh2009
2019-11-10 17:23:44

I’m too new to Racket to be highly productive. Right now, I’m developing some day trading tools in Racket to learn it.


steveh2009
2019-11-10 17:32:23

The older you get, the more you want to integrate rather than create from scratch. You realize your time is more valuable as you have less of it to live.


wwall
2019-11-10 19:14:35

hello. Can somebody say me how use scribble/lp and @interactive together?


soegaard2
2019-11-10 19:16:51

soegaard2
2019-11-10 19:17:09

soegaard2
2019-11-10 19:18:22

Check out jeapostrophe’s blog. I think he uses scribble/lp for most of his posts.



wwall
2019-11-10 19:24:43

my simple code



wwall
2019-11-10 19:25:28

in @interaction i want to see result 3 but i see test-plus: undefined; cannot reference an identifier before its definition


soegaard2
2019-11-10 19:27:44

Think of interaction as having a repl.


soegaard2
2019-11-10 19:28:25

@interaction[(+ 1 2)] works in the same way as entering (+ 1 2) into the repl.


soegaard2
2019-11-10 19:28:58

So if (test-plus 1 2) is going to work, you need to define test-plus in the repl first.


wwall
2019-11-10 19:31:00

i understand it. i have question how i can link my rkt file an interaction? which expression need for #:eval in @interaction?


wwall
2019-11-10 19:32:19

in rkt file have definition for test-plus. how i can say scriblle for use this module as part of eval?


soegaard2
2019-11-10 19:33:19

Do you need the interaction in the same file?


wwall
2019-11-10 19:33:49

yes


wwall
2019-11-10 19:34:14

i want to have code, docimentaton and example in one file


soegaard2
2019-11-10 19:35:28

Let me try an experiment - I am not sure you can use them in the same file. But I think it will work from into.scbrl


wwall
2019-11-10 19:38:46

file part1.rkt is very big, and if i use an intro file for examples - i’ll have a lot to rewrite , and the meaning of lp then lost


soegaard2
2019-11-10 19:46:26

A step on the way: into.rkt #lang scribble/manual @require[scribble/lp-include] @(require scribble/racket scribble/manual scribble/eval) @(define (make-eval) (define eval (make-base-eval)) (eval '(require "part01.rkt")) (eval '(require scribble/lp-include)) (eval '(lp-include "part01.rkt")) eval) @section{task 1.} @(require "part01.rkt") @(interaction #:eval (make-eval) (test-plus 1 2)) and part01.rkt #lang scribble/lp @(require scribble/racket scribble/manual scribble/eval) This is simple definiition @chunk[<testdata> (define (test-plus x y) (+ x y))] result of evalution is @interaction[(test-plus 1 2)] @chunk[<*> (require racket) (provide test-plus) <testdata>]


wwall
2019-11-10 19:58:56

ЯндексПереводчик

Thank you so much for the example, but it doesn’t quite fit me. D to think that do can be.


soegaard2
2019-11-10 20:00:47

I can’t see how @interaction would work in the same file. The chunks aren’t evaluated. They are collected in the <*> chunk and that’s what is exported.


soegaard2
2019-11-10 20:01:17

But I could be missing something.


soegaard2
2019-11-10 20:01:41

Anyone knows who wrote scribble/lp ? Matthew or Eli perhaps?



soegaard2
2019-11-10 20:05:19
#lang scribble/lp2
@(require scribble/base
          scribble/eval)

@title{An Example}

This would be a @bold{wonderful} way to accomplish things!

@chunk[&lt;*&gt;
        (define (f x)
          &lt;f-body&gt;)]

@chunk[&lt;f-body&gt;
        (* x x)]


And then, I could show an example:

@(begin
   (require syntax/location)
   (define here (quote-source-file))
   (define evaluator (make-base-eval))
   (evaluator `(begin
                (dynamic-require '(file ,here) #f)
                (current-namespace
                 (module-&gt;namespace '(file ,here))))))

@examples[
        #:eval evaluator
        (f 10)
]

soegaard2
2019-11-10 20:06:04

This ought to work with interaction instead of examples as in the example.


wwall
2019-11-10 20:10:33

Great! You’re a great man. Thank you very much. I already wanted to deal with macros and write my lp implementation - but you saved me. Thank you very much


wwall
2019-11-10 20:10:50

this code works fine


soegaard2
2019-11-10 20:11:22

Great to hear it works. I wonder how!


spdegabrielle
2019-11-10 21:30:25

Eeek! I’ve just noticed that the racket wiki home page still has Racket2 references on the home page. https://github.com/racket/racket/wiki If anyone with a GitHub account could change to rhombus-brainstorm I’d be most appreciative


sorawee
2019-11-10 21:55:32

Will do


sorawee
2019-11-10 22:08:40

The project description of https://github.com/racket/rhombus-brainstorming is also still “RFCs for Racket 2 design”


sorawee
2019-11-10 22:09:06

Only repo owner can fix that, I think.