Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    David DeSimone
    @DavidDeSimone
    lisp_obj.as_fixnum_or_error() if you want it to throw an error. If you know its a fixnum you can use lisp_obj.as_fixnum_unchecked() which is unsafe.
    that removes the tag and gives you the actual numerical value as an EmacsInt. If you want to convert to different types from there you can either use as or try_into depending on the conversion and what you want to do.
    Johan Sjölén
    @jsjolen_gitlab
    Oh duh, better not ask questions before breakfast :-).
    Johan Sjölén
    @jsjolen_gitlab

    So anyway, I've ported some of the bytecode interpreter: https://github.com/jsjolen/remacs/tree/bytecode .
    I've got a decent amount of instructions implemented and it runs some basic programs, for example:

    ;;;; Sorry for shoddy indentation
    (defun square () (* x 2))
    (let ((bf (byte-compile (lambda () (square 2)))))
         (rust-byte-code (aref bf 1) (aref bf 2) (aref bf 3)))
    
    (setq n 5)
    (let ((bf
    (byte-compile (lambda ()
                   (cond
                ((equal n 1) 3)
                ((equal n 2) 2)
                ((equal n 3) 1))))))
    (rust-byte-code (aref bf 1) (aref bf 2) (aref bf 3)))

    It's a bit shoddy, I use a lot of .unwrap() and some unsafe blocks -- at least the latter ought to be removed by the end.

    I'm gonna continue working on it until a decent version is available.

    There are a lot of instructions and most of them are very easy to port, so if someone wants to try it out I'm more than happy to take PR:s on my branch.
    I just need to split up my commits a bit and fix my Cargo.toml/Cargo.lock stuff.

    I do add two new dependencies which allow enums to be cast to u8, super useful for the bytecodes.
    Specifically I add the enum-primitive-derive and num-traits crates.

    Should I make a pull request when I believe that it's production ready or earlier?

    brotzeit
    @brotzeit
    heads up: remacs is actually "stalled". Sorry that I didn't mention it before. But if you are interested you can take a look at https://github.com/emacs-ng/emacs-ng
    Johan Sjölén
    @jsjolen_gitlab
    Aw jeeze, I didn't know! No worries, main thing I wanted to do is learn Rust anyway :)
    brotzeit
    @brotzeit
    :+1:
    Harry Fei
    @harryfei
    I wish we can re-fork emacs-ng to get a new remacs
    or remacs-ng
    haha
    Amanda
    @amanda:queersin.space
    [m]
    my brain keeps wanting to expand ng to newgrounds
    brotzeit
    @brotzeit
    I like it better than next generation ;)
    David DeSimone
    @DavidDeSimone
    put https://github.com/ruffle-rs/ruffle in emacs-ng, get flash in emacs
    Harry Fei
    @harryfei
    We are building a new browser named emacs-ng...
    Carlos Neira
    @cneira
    @harryfei is there a way to specify is_legacy bit to webrenderer so it could run on old gpus?, I'm using MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 ./src/emacs to make it run, if not I get this error [cneira@general-dynamics emacs-ng]$ ./src/emacs
    thread '<unnamed>' panicked at 'called Result::unwrap() on an Err value: [Shader(Compilation("brush_solid", "0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES\n")), Shader(Compilation("ps_text_run", "0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES\n"))]', src/webrender_backend/output.rs:250:54
    Harry Fei
    @harryfei
    Currently, there isn't. We can find a way to add option.
    David DeSimone
    @DavidDeSimone
    If there isnt an option in the WebRendwr API, worst case we can try to set those env vars for the user
    Kind of a hack, but its just a thought
    Carlos Neira
    @cneira
    Setting those envars just make it start but as my gpu does not support gsls 1.5 it behaves badly , the buffer is garbled , doing m-x garbles the current buffer and so on, so I thought if it was possible to make it work for old gpus or if gsls 1.5 is a must then webrender just runs not in all gpus
    Ivan Yonchovski
    @yyoncho
    @harryfei sounds like I am having that same issue
    Carlos Neira
    @cneira
    trying to call menu-set-font crashes with no implemented error, are there some pointers on how to implement that one ?
    David DeSimone
    @DavidDeSimone
    I believe that is being tracked by emacs-ng/emacs-ng#125 @cneira
    Carlos Neira
    @cneira
    what's need to implement that part? I could take a shot at it
    David DeSimone
    @DavidDeSimone
    @harryfei would know much better than me, he could give you the full details. But if you wanted to look at the code, webrender is mostly contained in https://github.com/emacs-ng/emacs-ng/tree/master/rust_src/src/webrender_backend. This specific line causing the panic looks like: https://github.com/emacs-ng/emacs-ng/blob/1a8275f2e73022a2a1625e6b5e8872ba6190e3e6/rust_src/src/wrterm.rs#L135-L140
    Carlos Neira
    @cneira
    @DavidDeSimone thanks!
    Carlos Neira
    @cneira
    @harryfei any pointers on debugging webrenderer ?
    Harry Fei
    @harryfei
    wrterm.rs is main file of webrender
    Personally, I think we can't implement emacs-ng/emacs-ng#125 easily.
    Because I find there is no easy way to implement tooltip window with winit/webrender
    I tried to change x_hide_tip to only return Qnil. But Get another crash.
    David DeSimone
    @DavidDeSimone
    I wonder how mozilla handles tooltip like windows in their projects
    if they have custom logic for drawing it out
    Carlos Neira
    @cneira
    @harryfei is the main idea of webrender to intercept c calls for the gui and provide the webrender version of the same object? I was reading about webrender and was mostly focus on css processing
    Harry Fei
    @harryfei
    We use webrender as same as GTK in emacs-ng.
    webrender itself is a powerful 2D graphic library. We can use it to render lines, shapes and texts.
    jogama
    @jogama
    I understand that remacs is stalled. Would it make sense to pin the relevant issues to the stall, so that they always show up at the top of the issues page?
    brotzeit
    @brotzeit
    I would add a link to the emacs-ng repo, but I'm not sure if this is ok for the other former maintainers since the goals of this fork are different
    jogama
    @jogama
    ¿? What is the relationship between emacs-ng and remacs? I've read both README's, and it's not clear to me how/whether their development is intertwined. Is it that they're both stuck on the same macOS issue? (also, ¡many thanks @brotzeit for taking the time to reply!)
    David DeSimone
    @DavidDeSimone
    emacs-ng uses some remacs code, but is an additive layer over native emacs. The idea is to use rust to add cool and useful things to emacs in an additive way while still being able to merge upstream patches. You can build emacs-ng on macOS currently.
    brotzeit
    @brotzeit
    and some of the maintainers are members that already contributed to remacs
    jogama
    @jogama
    I see, thank you both.
    AK
    @kuveaux
    wait, why is remacs stalled? just curious
    Harry Fei
    @harryfei
    most of us dive into https://gitter.im/emacsng/community. :smile:
    brotzeit
    @brotzeit
    @kuveaux I think one of the major reasons was that we couldn't make upstream merges fast enough since we touched too much C code
    at least it was a big one for me
    Amanda
    @amanda:queersin.space
    [m]
    There was also a bunch of big undertakings taken on at once that we lost the developer capacity to carry out, like redoing our CI and entirely manually reapplying our changed in a way that kept the C code we're replacing around, just disabled by the preprocessor
    brotzeit
    @brotzeit
    the goal of remacs was too ambitious IMO, if they would stop emacs development it would be possible but this way, no chance
    brotzeit
    @brotzeit
    there were complaints that the readme doesn't contain a note about the status of the project...I would archive the project so people don't work on pull requests that won't get merged
    ShalokShalom
    @ShalokShalom
    Yeah, some official announcement.