These are chat archives for ChaiScript/ChaiScript

6th
Apr 2015
Victor Lopez
@VictorJL
Apr 06 2015 02:12
Inside ChaiScript, use does not return anything but void. I'm using global objects by the moment to compensate.
Jason Turner
@lefticus
Apr 06 2015 02:15
oh, oops
I really thought it did
you are correct, I see the mistake
would you mind making a little to-do list of issues you hit? Like better global support from inside of script, function eval, use... whatever else?
Victor Lopez
@VictorJL
Apr 06 2015 02:18
Sure.
Jason Turner
@lefticus
Apr 06 2015 02:18
I think I've figured out how to get some better runtime performance. I'm going to try and work on chaiscript for most of tomorrow if I cna
can
Andreas Reischuck
@arBmind
Apr 06 2015 02:21
@lefticus what do plan to do?
I have worked on a new... faster and cleaner Boxed_Value and boxed_cast implementations
I ran into several issues while trying to reduce the pointer mess
Jason Turner
@lefticus
Apr 06 2015 02:24
I was thinking about trying to make it so that actual values can be stored, not just shared_ptr<> and reference_wrapper<> by taking advantage of the std::shared_ptr<> "alias constructor" that I just learned existed
and yes, I've also tried to reduce the pointers created in the past and ran into several issues
Andreas Reischuck
@arBmind
Apr 06 2015 02:25
I have written a new test setup... and it does what I expect it to
Jason Turner
@lefticus
Apr 06 2015 02:25
for some history: this code original relied on boost, and much of the implementation used what was easy to use because boost provided it.
for example: boost::any
so do you have a branch or anything committed to look at?
Andreas Reischuck
@arBmind
Apr 06 2015 02:26
I fix some remaining tests and will create a new repository
This is the basic concept
T&        == T
const T   == cw<T>
const T&  == cw<T>

[SOURCE]        [STORE]    [AnyType]
int          => int        <int>
ref<int>     => ref<int>   <int>[ref,ptr]
int*         => int*       <int>[raw,ptr]
shptr<int>   => shptr<int> <int>[sh,ptr]

cw<int>        => int        <int>[const]
cw<ref<int>>   => ref<int>   <int>[const,ref,ptr]
cw<int*>       => int*       <int>[const,raw,ptr]
cw<shptr<int>> => shptr<int> <int>[const,sh,ptr]

ref<const int>   => ref<int>   <int>[const,ref,ptr]
const int*       => int*       <int>[const,raw,ptr]
shptr<const int> => shptr<int> <int>[const,sh,ptr]
cw - const_wrapper (custom)
shptr- std::shared_ptr
Jason Turner
@lefticus
Apr 06 2015 02:27
wow
how's the performance / etc looking?
Andreas Reischuck
@arBmind
Apr 06 2015 02:28
I don't know, it's not anything I can just drop in
Jason Turner
@lefticus
Apr 06 2015 02:28
ah
Andreas Reischuck
@arBmind
Apr 06 2015 02:29
The implementation is much simpler... and reducing pointers should gain performance
Jason Turner
@lefticus
Apr 06 2015 02:29
so it's a complete replacement for boxed_value and boxed_cast, written from scratch?
and, isn't it 4:00 where you live?
(gitter says dresden)
Andreas Reischuck
@arBmind
Apr 06 2015 02:30
it is... I am @ revision party...
Some hours left until we leave to head back to Dresden :)
Jason Turner
@lefticus
Apr 06 2015 02:35
Wow, sounds awesome. I love Germany, by the way. Lived there from 1985-1987, then Belgium 1987-1992. Just went back to Germany this summer and took my wife - Heidelberg, rothenburg ob der tauber, Fussen, Neushwanstein, some time on the Burgenstrasse
I will wait to do any Boxed_Value cleanups I was thinking of and see if I can integrate your version.
Jason Turner
@lefticus
Apr 06 2015 02:44
@arBmind we might even consider moving to Germany if there was more Mexican food available there... @VictorJL There is a strong Mexican influence where I live
Victor Lopez
@VictorJL
Apr 06 2015 02:50
@lefticus Ha, excellent.
@lefticus I suppose you love tacos.
Andreas Reischuck
@arBmind
Apr 06 2015 03:39
@lefticus sorry got disturbed here. I guess you can find everything in Germany, also Mexican food... You will just have to dig a bit deeper.
@lefticus these tests are awful... boxed_cast_test.cpp line 138 there is an error!
Jason Turner
@lefticus
Apr 06 2015 03:45
Mostly it was the peppers. getting good chilis outside of America seems to be hard...
wow those tests do look bad. it's been a while
what's the error?
Andreas Reischuck
@arBmind
Apr 06 2015 03:46
ispod && false - the condition does not belong there
Jason Turner
@lefticus
Apr 06 2015 03:47
yes that would always be false... I'm surprised no compiler has warned on it
Andreas Reischuck
@arBmind
Apr 06 2015 03:51
I have new versions :D
Jason Turner
@lefticus
Apr 06 2015 03:56
if you haven't seen this, it's all of the compilers I test on: http://chaiscript.com/ChaiScript-BuildResults/full_dashboard.html
Andreas Reischuck
@arBmind
Apr 06 2015 03:58
I have seen it... and also considered using it for us... :)
So all boxed_cast_test is done...
Jason Turner
@lefticus
Apr 06 2015 04:01
one of my client uses it for a couple of projects: http://nrel.github.io/OpenStudioBuildResults/full_dashboard.html http://nrel.github.io/EnergyPlusBuildResults/full_dashboard.html but I've never really tried to package up the build system for anyone else to use
it's all written in ruby and uses github for the backend
and assumes you're using cmake
Andreas Reischuck
@arBmind
Apr 06 2015 04:02
I know... Ruby was on the good side for us
Jason Turner
@lefticus
Apr 06 2015 04:04
that was my first real ruby project, so I'm sure the code needs help
was / is
just wrote it this past year
Andreas Reischuck
@arBmind
Apr 06 2015 04:05
For us Github is the main issue... We are going with a modified Buildbot for now
Victor Lopez
@VictorJL
Apr 06 2015 17:26
CS is getting my variables corrupted.
When handling references. As it seems.
I can't identify in which case.
Victor Lopez
@VictorJL
Apr 06 2015 17:35
When using +=
I'll get that in the todo list.
Jason Turner
@lefticus
Apr 06 2015 17:40
I'll need a specific example.
Victor Lopez
@VictorJL
Apr 06 2015 17:40
Strange, maybe it has nothing to do with CS, it happens when origin values are lower than the size of a 2d object.
Jason Turner
@lefticus
Apr 06 2015 17:46
is it possible you have some kind of a stack issue? You're referencing some value that's popped from the stack?
Victor Lopez
@VictorJL
Apr 06 2015 17:54
I'm writing values by hand, it's OpenGL and the way it draws vertices.
Jason Turner
@lefticus
Apr 06 2015 17:54
oh I don't know anything about that
Victor Lopez
@VictorJL
Apr 06 2015 17:56
Yeah, but it's really strange because it did never happen before, it's a fixed range of values as it seems, the ones that are causing strange drawings. I'll fix it up and then will come back.
I'm creating the first sketch of the Engine. It will be able to load actors, add animations and edit the game scenes with these.
ChaiScript is fine so far.
Jason Turner
@lefticus
Apr 06 2015 17:57
ok
I'm working my way through bugs right now
Andreas Reischuck
@arBmind
Apr 06 2015 18:07
@lefticus have you had a chance to look at my stuff?
I guess we would need a bit more discussion about these changes
Unfortunately it's very hard for me to work with your codebase. I would not have any debugging or test support.
Jason Turner
@lefticus
Apr 06 2015 18:13
I have looked at it, but not closely enough to see if I could fold it in yet
Andreas Reischuck
@arBmind
Apr 06 2015 18:14
It would be a breaking change...
Jason Turner
@lefticus
Apr 06 2015 18:15
yes
Andreas Reischuck
@arBmind
Apr 06 2015 18:15
converting to shared_ptr is only possible if a shared_ptr was stored
Also many minor parts I could not understand have been left out. As they seem not to be covered by tests, I guess it's ok :)
What I have seen, there is a high chance of feature envy in your codebase...
Features tend to create complexities everywhere, unless you take the time to refactor all the time
Jason Turner
@lefticus
Apr 06 2015 18:17
For the past year or so I've only touched the code if I could make it simpler and remove stuff
you should have seen it before I started that
I've tried to make every change (even new features) remove code, make smaller builds, make faster builds, reduce compile time
Andreas Reischuck
@arBmind
Apr 06 2015 18:21
Ok, great so your mindset is in the right place... good to know
Jason Turner
@lefticus
Apr 06 2015 18:23
the reliance on shared_ptr was before I appreciated how much cost was involved in dynamic allocations
so the main question I have is, how much breakage am I willing to accept to make things better? It's been >5 years since the language semantics or API has changed in any noticeable way
Andreas Reischuck
@arBmind
Apr 06 2015 18:28
That's nothing I can help you with... The python 2 to 3 thing was bad. But delaying breaking changes will not help either
Speaking of breaking changes... I would suggest getting a strategy for reducing and finally eliminating the syntax duplications
likevar vs. auto and fun vs. [](){}
Jason Turner
@lefticus
Apr 06 2015 18:40
I don't believe we have a duplication in fun and [](){} do we? We thought about adding the pure C++11 version but it cause a lot of parser ambiguity issues for us
Andreas Reischuck
@arBmind
Apr 06 2015 18:41
ok. I had two things in mind, but could not find the second now :)
Jason Turner
@lefticus
Apr 06 2015 18:41
we do allow fun[x](){} and fun(){} for capture or not
so, I think your const/non-const cleanups make a very good point
Andreas Reischuck
@arBmind
Apr 06 2015 18:42
that should be ok
Jason Turner
@lefticus
Apr 06 2015 18:42
and the code that I have in boxed_casts that test for that is a waste
and I plan to at least borrow that
it'd make the code more simple and more maintainable
Andreas Reischuck
@arBmind
Apr 06 2015 18:43
great
Jason Turner
@lefticus
Apr 06 2015 18:49
oh, and most of the complexity (or a lot of it) in boxed_cast is to be able to handle things like auto f = chai.eval<std::function<std::string (int)>>("to_string"); Figuring out how to get C++ to detect that kind of conversion at compile time was difficult for me. There's probably a simpler way it could have been handled, but I needed to be able to detect a conversion to std::function and extract the real type Proxy_Function then create the necessary wrapper and return that
(which is the kind of thing that as far as I know, no other scripting engine can do)
Jason Turner
@lefticus
Apr 06 2015 18:57
@VictorJL it's not impossible that chaiscript is causing a memory corruption, but I do run the entire test suite through a memory checker with each release, so I would be surprised. But if you do end up tracking your issue to chaiscript, let me know
Andreas Reischuck
@arBmind
Apr 06 2015 19:07
@lefticus I have not looked into this... but it seems very unrelated to boxed_cast itself
what I see is that boxed_cast may throw 3 exceptions... with 2 you can still have a valid run
and most of the complexity is because each conversion-class has two convert methods
My conversion-triple is one direction... If you want both, just add another triple...
Jason Turner
@lefticus
Apr 06 2015 19:15
ah, I think we might have been talking about two different things
correct?
Andreas Reischuck
@arBmind
Apr 06 2015 19:17
Yes
Jason Turner
@lefticus
Apr 06 2015 19:19
I didn't look as closely at that aspect of your code yet
Andreas Reischuck
@arBmind
Apr 06 2015 19:19
It's just a sketch... no tests ever run that part