Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Markus Westerlind
@Marwes
Sorry
Waiting for travis to build a new container
Aashish Welling
@omegablitz
no worries, was just letting you know in case u didn't
Markus Westerlind
@Marwes
Can't host it on gh-pages since the gluon code is executed server side
Aashish Welling
@omegablitz
oh yeah, i forgot about the code executor
i guess theoretically that could also be run clientside, but maybe not worth the effort
Markus Westerlind
@Marwes
I did hack together a build which ran the code with WASM once, super hacky though and bitrotted now
It all serves to dogfood gluon though, the backend is written in gluon so
(as much as possible)
ikaeon
@ikaeon
Thanks for the impressive work. I was trying to marshall a rust struct I already have in my rust code to be available to the gluon vm. But now the rust code has a type mismatch ^^^^^^^ expected &mut gluon_vm::thread::ActiveThread<'_>, found f32with compiling.
struct AsxTimeseries { date:Vec<u32>, open:Vec<f32>, high:Vec<f32>, low:Vec<f32>, close:Vec<f32>, volume:Vec<u32> }
Try this again
  #[gluon(vm_type = "asx")]    
  struct AsxTimeseries {    
    date:Vec<u32>,    
    open:Vec<f32>,    
    high:Vec<f32>,    
    low:Vec<f32>,    
    close:Vec<f32>,    
    volume:Vec<u32>    
  }
Sorry keep hitting enter for line breaks.
ikaeon
@ikaeon
My assumption was marshalling wouldn't change the existing rust code, it this the wrong approach?
Markus Westerlind
@Marwes

Do you have a standalone reproduction

#[gluon(vm_type = "asx")]    
  struct AsxTimeseries {    
    date:Vec<u32>,    
    open:Vec<f32>,    
    high:Vec<f32>,    
    low:Vec<f32>,    
    close:Vec<f32>,    
    volume:Vec<u32>    
  }

Works on master

at least
ikaeon
@ikaeon
Thanks Markus. The issue is/was the Pushable trait overloads Vec::push, so when I use Pushable all the previous std::Vec::push calls in the code break.
Markus Westerlind
@Marwes
Ah, seen that sometimes as well Opened gluon-lang/gluon#846
ikaeon
@ikaeon
Thanks. I got around the problem by not importing(use) Pushable and apply the full Path gluon::vm::api::Pushable
I have been trying to share a BTreeMap<String,AsxTimeseries> between gluon and rust. I have removed all the compile errors but the gluon script panics at the moment.
ikaeon
@ikaeon
I am trying to return a BTreeMap<String,String> from a rust function but I keep getting panics: thread 'main' panicked at 'context', /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/gluon_vm-0.15.1/src/thread.rs:2901:30 if I have multiple items in the BTreeMap or thread 'main' panicked at 'Attempted to pop Frame { offset: 0, state: Unknown, excess: false } but id was expected', /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/gluon_vm-0.15.1/src/thread.rs:1936:13 if the BTreeMap has only 1 item and no panic if a empty(BTreeMap::new()) is returned. I have been at this for a couple of days now because I really am interested in trying out Gluon but I just cannot make it work.
Markus Westerlind
@Marwes
Can you open an issue with the full backtrace and whatever else information you can provide (ideally a standalone example)
BTreeMap conversion is a bit complicated so hard to say exactly what went wrong
ikaeon
@ikaeon
Ok, done. Thanks. Sorry I simply assumed I done something wrong as I am not a programmer just a unskilled factory worker.
Abcd Efgh
@efgha4351_gitlab
Another language, which is a possible alternative to Gluon, is Slider, available at http://mrsename.blogspot.com/
Steven
@crides
gluon-lang.org seems to be down?
Sean Leffler
@sdleffler
Hey y'all! I looked away from Gluon for a year and it turned into embedded Haskell... I'm impressed as hell. :D Anyways was curious to know if there's currently any support for coroutine-ish stuff, like a coroutine monad or such in the stdlib or even builtin? Or whether any such is planned. I'm looking at designing a little DSL in Gluon which would end up as a monadic list of actions, and I'd love to be able to have state be yielded back to Rust to be continued on another frame of my game project. I suppose I'd probably be best off returning Functions from Gluon? Cheers!
Sean Leffler
@sdleffler
Also, a simpler question: I'd like to be able to use something like Haskell's undefined or Rust's unimplemented!()/panic!() in that they effectively have the type forall a . a. I tried implementing my own little undefined as an infinite loop but Gluon complained about some stricter requirements for the last expression of a recursive binding. Is there something for this that I'm missing which is already in the stdlib?
Markus Westerlind
@Marwes
You can use error : String -> a. Since gluon is not lazily evaluate you can't define undefined in a useful way. Not sure exactly what the error is without some example code
Markus Westerlind
@Marwes
So there is an effect monad which I think should fit the "couroutine" case well, however there is currently no way to drive an effect monad from the rust side
(at least none exposed and documented for users)
rustrust
@rustrust
calling io.print "a" and then io.print "b" in a gluon script only prints "b" . is this expected behavior?
Steven
@crides
Sort of? If you are just calling the function, because the returned IO () monad is not evaluated/lifted the function call is optimized out. You need to use seq in this case
If you're embedded, you can also turn off optimization
rustrust
@rustrust
i am playing around in the gluon repl, and if i say this: type Op = | Add | Sub | Div | Mul the repl will just sit there after i hit return (on both debug and release)
i added some extra lines of code after that, like so:
type Op = | Add | Sub | Div | Mul
let io = import! std.io
io.print "foo"
and so then that will print foo0 (i'm not quite sure where the 0 comes from)
but if i say :info Op, it says that binding Op is not defined
Markus Westerlind
@Marwes
The repl doesn't support defining types atm unfortunately
elonzyy
@elonzyy
alt
I did a basic brep modeller using rust+wasm+gluon. Anybody interested?