Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Alessandro Pignotti
    @alexp-sssup
    Cool solution
    Ray Burgemeestre
    @rayburgemeestre
    On Ubuntu 15.10 I had a runtime problem with all the server examples, they compiled okay, but whenever I hit the webserver that is running pion it would hit 100% cpu and output nothing. So I figured I compile libpion myself in order to debug, but I can't find the sourcecode for version 4 anywhere online (looks like the author (splunk) didn't include it in the new github repo). So I updated all the pion stuff with version 5, and stuff seems to work great, except the async_chat example.
    It seems to have something to do with the Promise code, so it's probably my lack of understanding how it should work, I'm stuck on it for a few hours now so I was hoping if someone can point me into some direction where the problem could be?
    I can understand this doesn't have highest priority, but I'll share my code changes and stacktrace of the segfault: https://github.com/leaningtech/cheerp-utils/compare/fb0f3e67ab0f83d8a2a7f31684b84b6ea4ff7ead...rayburgemeestre:pion5?expand=1 gist containing the bt: https://gist.github.com/rayburgemeestre/ddd88253efd46f8dd925
    Ray Burgemeestre
    @rayburgemeestre
    (So, the trigger for the segfault is: sendMessageRemote("Test message"); in async_chat.cpp)
    Alessandro Pignotti
    @alexp-sssup
    @rayburgemeestre I'm taking a look at the issue but I will need a few more days
    Ray Burgemeestre
    @rayburgemeestre
    no problem, I'm also still improving the changes, I noticed I used a slightly newer version of pion 5 (5.0.6) then is available by default in the Ubuntu 15 packges (probably the same as Ubuntu 14), so I'm adjusting the code a bit so eventually it will work out of the box hopefully. (I can only work on it every now and then)
    Ray Burgemeestre
    @rayburgemeestre
    I added another commit to my branch, at least I have some extra clarity. Still the async_chat doesn't work, but the stacktrace is no longer the same.
    Some stuff I discovered: with the ubuntu provided pion5 (libpion-dev iirc) package(s) I get that the cpu would hang at 100% cpu. It seems really "racy", every now and then you get a response from the webserver, only occasionally.
    So I build pion (tag 5.0.6) myself with g++: works, but still random crashes. Also I had to remove the BOOST_ASIO_DISABLE_MOVE define or it would segfault immediately all the time.
    So I build it with clang++ this time, had to patch it slightly (rayburgemeestre/pion@4013811) and build it with CXX=/opt/cheerp/bin/cheerp++ ./configure etc. --> This works, so far no random crashes (only consistent crashes :smile: )
    Just for completeness I will add the stacktrace I get now whenever I open async_chat.html in the browser: https://gist.github.com/rayburgemeestre/cee5b6daf8b97754137c I hope to spent some time debugging this specifically in a few days
    Alessandro Pignotti
    @alexp-sssup
    @rayburgemeestre I committed in the cheerp-utils repository a fix that should let the old pion4 version work with new distros. I also plan to update to pion5 (I may base the work on your patches) later on
    Ray Burgemeestre
    @rayburgemeestre
    Awesome, I can confirm in master the server examples work for me with pion4 now in Ubuntu 15.10.
    lukes3315
    @lukes3315
    Hey! Hope all is well ! I have a question, I have c++ platform specific code (android) to get accelerometer/gyro data, using the ASensorManager, is there a way to have cheerp's clang use the android sysroot (e.g. /opt/cheerp/clang++ --sysroot /path/to/android/root/ --arch armv7 --arch armv7-a) ? Since this c++ code is only executable on the Android platform and not any other browser, would cheerp still be able to "convert" it to JS, and have it executed on the specific platform ? I didn't see any documentation on cross compilation using cheerp
    @alexp-sssup
    Alexey Starfall
    @acterhd
    Hello, cheerp support webassembly?
    Alessandro Pignotti
    @alexp-sssup
    @acterhd hello, at the current stage webassembly does not provide the features that cheerp requires, namely support for objects. That's in the webassembly roadmap though, so we plan to support webassembly as an additional target beside JS when the wasm technology matures
    Gaurav
    @imgauravdewan_twitter
    Hello, I want to quickly compile a large C++ codebase that contains exception-handling to JS using cheerp. Emscripten ignores try catch block in optimized build. But cheerp gives compilation error - cannot use try throw with exceptions disabled.
    I tried -fexception but still got llvm.eh intrinsic error - Cheerp does not support exceptions. And it does not ignore them if they are there in AST/code
    Gaurav
    @imgauravdewan_twitter
    Is there any quick way or C++ trick to remove the exceptions from the code ? I can #define try to nothing. But what to do with (1)catch(int& x) catch(...) (2)throw; void f() throw() ?? Is there any non-intrusive (and non-destructive) way (other than removing throw catch from the code)?
    Alessandro Pignotti
    @alexp-sssup
    Hello @imgauravdewan_twitter , indeed Cheerp does not support exceptions currently, mainly due to the high overhead that JS engines introduce when using JS try{}catch constructs. There is also no way to automatically drop exception blocks. My suggestion would be to go over the codebase and use #ifndef CHEERP syntax to ifdef out the catch blocks and the try keyword.
    gitter has eaten my keywords, #ifndef __CHEERP__
    Gaurav
    @imgauravdewan_twitter
    I found a way
    1) try – #define try / nothing /
    2) catch(…) catch(int& x) etc – Use variadic macro #define catch(…) if(true)
    a. alternative: grep the source code and replace it with if(false) or while(false) and ignore compiler warning
    3) throw obj; - #define throw /nothing /
    4) void f() throw(int) – Although #define throw(…) /nothing/ works but it conflicts with clause 3 above – so manually changing the code for this construct under macro #if EXCEPTION_ENABLED recommended.
    Alessandro Pignotti
    @alexp-sssup
    I think catch should be defined to if (false) if you want to ignore exceptions
    Gaurav
    @imgauravdewan_twitter
    yea corrected
    Alessandro Pignotti
    @alexp-sssup
    to keep the codebase compatible with regular compiler I would suggest adding all the defines under an #ifdef __CHEERP__
    Gaurav
    @imgauravdewan_twitter
    yes sure
    I will start porting next week - now i am clear on most concepts of cheerp
    I tested STL, variadic templates etc and sample programs - seem to be working fine
    Is there any gotcha I need to be careful of (not documented in wiki) ?
    Thanks
    Alessandro Pignotti
    @alexp-sssup
    Keep in mind that type unsafe casting of pointers is not supported, most type safe C++ code works like a charm though.
    What is the project about?
    If you can share this information
    Gaurav
    @imgauravdewan_twitter
    This is company internal project at the moment and we are investigating optimum C++ to JS conversion workflow. We have been able to test asm.js and wasm and now want to evaluate this different approach.
    Karl zwinnen
    @karl_zwinnen_twitter
    Nice work! I'm definitely going to expiriment with this!
    One thing puzzles me though.. it states that 64 bit integers are supported natively (http://blog.leaningtech.com/2016/02/cheerp-12-c-to-javascript-with-faster.html), but Javascript doesn't natively support 64 bit integers (like mentions here: https://github.com/leaningtech/cheerp-meta/wiki/64-bit-integer-support)?
    Alessandro Pignotti
    @alexp-sssup
    @karl_zwinnen_twitter 64bit integers in clang are compiled to multiple 32bit operations. Since the code is generated so early in the compilation process the code can then be optimized by LLVM to reduce the overhead of such non-native implementation
    Plaristote
    @Plaristote
    Hi guys ! I've been experimenting with cheerp, and so far so good, I know this is still experimental, but I've found nearly anything I could possibly need ! Still, I'm wondering, is there already a way of making a javascript function from a lambda, apart from the EventListener ?
    Alessandro Pignotti
    @alexp-sssup
    The cheerp::Callback method generates an client::EventListener* pointer that is actually a JS function. What is the limitation you are encountering?
    Plaristote
    @Plaristote
    Indeed, I was wrong. I've been able to do what I wanted using cheerp::Callback. Thanks !
    Alessandro Pignotti
    @alexp-sssup
    Cool
    jiams
    @jiams
    can cheerp work with glup or webpack?
    Alessandro Pignotti
    @alexp-sssup
    @jiams Cheerp can generate a module with the -cheerp-make-module command line option. Since it's normal JS you can use any toolchain that you like, but we recommend that you don't minimize the output as Cheerp generates carefully optimized code and minimizer can actually make it worse. Cheerp generates minified code automatically unless you explicitly set the -cheerp-pretty-code option
    jezzarb94
    @jezzarb94
    hi
    how do i get access to the cheerpj program
    Alessandro Pignotti
    @alexp-sssup
    @jezzarb94 cheerpj is currently only available in beta for early adapters. If you want to apply to the early adapters program please drop us a line at info@leaningtech.com describing your project.
    Aleksander Guryanov
    @caiiiycuk
    Hi guys! Can somebody explain or provide link to docs, where I can found how to use cheerp with cmake? Thanks
    Aleksander Guryanov
    @caiiiycuk
    I trying to use /opt/cheerp/bin/cheerpwrap cmake .., but in this case make uses wrong compiler (/usr/bin/clang)
    Alessandro Pignotti
    @alexp-sssup
    @caiiiycuk you need to use the cmake toolchain file provided in Cheerp (/opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake). -DCMAKE_TOOLCHAIN_FILE=/opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake
    Kibeom Kim
    @kkimdev
    Hi, I have a license question. To my understanding Cheerp is released as GPL v2 but does it also affects the resulting wasm binary?
    JF Bastien
    @jfbastien
    @sderossi / @alexp-sssup Hi ! Congrats on the wasm launch :) I was wondering if you were interested in joining the CG? https://www.w3.org/community/webassembly/ We've mostly only had Emscripten representation for tooling, and it would be great to have types of producers.