Stories
Slash Boxes
Comments

SoylentNews is people

posted by n1 on Friday January 13 2017, @07:34PM   Printer-friendly
from the to-vi-or-not-to-vi dept.

Submitted via IRC for TheMightyBuzzard

I am delighted to announce Remacs, a project to port Emacs to Rust!

Emacs, at its heart, is a lisp interpreter written in C. In Remacs, we're replacing this C code with Rust, and all the elisp you know and love will just work.

If you've ever fancied contributing to core Emacs, this is a great opportunity to learn the internals. There's tons of low hanging fruit, we have a list of good first bugs and even a walkthrough of writing your first elisp function using Rust.

Rust is perfect for this because we can port incrementally. If you want to replace the entire regular expression engine, you can do that. If you just want to replace this function here, you can do that and the C code won't even notice. You will have a full-blown Emacs every step of the way.

[...] Remacs is based on Emacs 25.2. We've got enough type definitions that you can write interesting built-in functions, but the project is still at a very early stage. Using these, we've got a few built-in elisp functions written entirely in Rust: some arithmetic, some type checks, and even some basic list functionality.

I'll stick to MrPlow for now, thanks. He's Rust enough for me until his code stops looking like a noob wrote it.

Source: http://www.wilfred.me.uk/blog/2017/01/11/announcing-remacs-porting-emacs-to-rust/


Original Submission

This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 1, Funny) by Anonymous Coward on Friday January 13 2017, @07:38PM

    by Anonymous Coward on Friday January 13 2017, @07:38PM (#453420)

    Lame. If it's not rewritten in node.js it's just not cool enough.

    • (Score: 2) by ikanreed on Friday January 13 2017, @07:39PM

      by ikanreed (3164) Subscriber Badge on Friday January 13 2017, @07:39PM (#453422) Journal

      Please. Where's the react shadowdom?

    • (Score: 0) by Anonymous Coward on Friday January 13 2017, @09:41PM

      by Anonymous Coward on Friday January 13 2017, @09:41PM (#453473)

      FFS don't give these kids ideas...

    • (Score: 3, Interesting) by DannyB on Friday January 13 2017, @09:50PM

      by DannyB (5839) Subscriber Badge on Friday January 13 2017, @09:50PM (#453479) Journal

      I wouldn't complain about rewriting Emacs in node.js, as long as, you first rewrite node.js in Rust.

      --
      What doesn't kill me makes me weaker for next time.
  • (Score: 0) by Anonymous Coward on Friday January 13 2017, @07:45PM

    by Anonymous Coward on Friday January 13 2017, @07:45PM (#453425)

    nemacs = emacs ported to /dev/null

    • (Score: 2, Insightful) by Anonymous Coward on Friday January 13 2017, @07:52PM

      by Anonymous Coward on Friday January 13 2017, @07:52PM (#453430)

      Isn't that already called "vim"?

  • (Score: 0) by Anonymous Coward on Friday January 13 2017, @08:15PM

    by Anonymous Coward on Friday January 13 2017, @08:15PM (#453439)

    Only question: why? Just for fun? Promotion of Rust?

    • (Score: 5, Funny) by Anonymous Coward on Friday January 13 2017, @08:19PM

      by Anonymous Coward on Friday January 13 2017, @08:19PM (#453441)

      Old code is bad because it's mature and well-debugged. It needs to be rewritten and have all sorts of new bugs introduced.

      • (Score: 3, Insightful) by Lester on Friday January 13 2017, @10:14PM

        by Lester (6231) on Friday January 13 2017, @10:14PM (#453507) Journal

        Funny? Perhaps sarcastic, but i's not a joke. It is a very intelligent comment, he has bit in the nail

        • (Score: 1, Insightful) by Anonymous Coward on Friday January 13 2017, @11:30PM

          by Anonymous Coward on Friday January 13 2017, @11:30PM (#453574)

          I guess we should count ourselves lucky that these modern-day software "engineers" aren't in a real engineering profession. They'd be trying to rework tried-and-true designs and principles because they're "old" and "legacy." We'd have a bunch bridges, skyscrapers and highways that would be falling apart due to design flaws because they thought they new better than those "old people" that came before them.

          • (Score: 1) by Lester on Wednesday January 18 2017, @12:51PM

            by Lester (6231) on Wednesday January 18 2017, @12:51PM (#455355) Journal

            I suppose it is a sarcastic answer to my comment.

            Is there any reason to knock down the Empire State Building, just to rebuild it with the same height, the same square meters, just exactly the same?. If the current Empire State Building has problems, cracks, etc, let's do it, but let's build a better building, not the same but with modern materials and tools.

            We have an old bridge paved it with two lanes where cars go up and down. If you want a wider bridge with more lanes, a stronger bridge because it has support heavy trucks, let's remove it and build another. But if we needn't more "features", the bridge is solid (maybe 1000 year there). Why should remove it?.

            I don't mean that we should stop innovation, just that starting from scratch for doing exactly the same thing makes no sense, and in the case of software is prone to new bugs, just to get the same.

            Do you want a new editor emacs-like, improving x,y,z, adding a,b,c that is too difficult to add to the current code? Code it in Rust, or Go, or Swift, or Erlang. But to get the same emacs we have now... why? It has no bugs and it looks that does what user expect it should do. Rewriting a clone in another language makes no sense, you will have the same but with more bugs. That is unless you want to test the language.

            By the way, I suppose emacs was a big improvement for those years editors state of art, but I feel happy that many people has had the idea or writing new editors, no matter in what language. As some said "Emacs is a great operating system, lacking only a decent editor".

      • (Score: 2) by davester666 on Saturday January 14 2017, @08:00AM

        by davester666 (155) on Saturday January 14 2017, @08:00AM (#453737)

        and it must be able to run in a browser.

      • (Score: 2) by LoRdTAW on Saturday January 14 2017, @04:31PM

        by LoRdTAW (3755) on Saturday January 14 2017, @04:31PM (#453824) Journal

        Not funny but true. I get that new languages have some benefits. I was recently playing with Rust and it feels nice compared to c. But to rewrite an existing OS (not that's funny!) in Rust just for the sake of it is well... pointless. Though, far be it for me to tell someone what to do with their time. Have fun I guess.

    • (Score: 2, Informative) by Anonymous Coward on Friday January 13 2017, @08:37PM

      by Anonymous Coward on Friday January 13 2017, @08:37PM (#453446)

      Only question: why?

      Hipsters.

    • (Score: 1, Funny) by Anonymous Coward on Friday January 13 2017, @08:41PM

      by Anonymous Coward on Friday January 13 2017, @08:41PM (#453448)

      Because Rust Never Sleeps.

    • (Score: 0) by Anonymous Coward on Friday January 13 2017, @08:50PM

      by Anonymous Coward on Friday January 13 2017, @08:50PM (#453450)

      If you were charged with ensuring that a programming language is robust and usable (or just learning that language), wouldn't implementing something established and well known be a great way to do that? Well established behavior patterns to emulate. Why Emacs? *shrug* It's a pet project of a few devs that got a blog post and a soylent article.

      • (Score: 0) by Anonymous Coward on Friday January 13 2017, @08:54PM

        by Anonymous Coward on Friday January 13 2017, @08:54PM (#453452)

        Unlikely. Reading the blog and the github page, this is just Rust hipsterism.

      • (Score: 1, Touché) by Anonymous Coward on Friday January 13 2017, @08:54PM

        by Anonymous Coward on Friday January 13 2017, @08:54PM (#453453)

        Why Emacs?

        Remember when they said they wanted to write an operating system in Rust? Now all it needs is a decent text editor.

        • (Score: 0) by Anonymous Coward on Friday January 13 2017, @09:12PM

          by Anonymous Coward on Friday January 13 2017, @09:12PM (#453461)

          There is already vi mode for it. Three of them, if I remember correctly.

      • (Score: 0) by Anonymous Coward on Friday January 13 2017, @09:07PM

        by Anonymous Coward on Friday January 13 2017, @09:07PM (#453459)

        If they wanted to solicit my help, they should have picked porting nethack.

    • (Score: 2, Troll) by Nerdfest on Friday January 13 2017, @09:26PM

      by Nerdfest (80) on Friday January 13 2017, @09:26PM (#453466)

      Yeah, this would not be at the top of the list of things I'd do in Rust. I'd pick stuff like openSSH and other things where buffer overflows and memory allocation mistakes create security exploits. Hell, I'd do an operating system before Emacs, or is that a contradiction?

      • (Score: 2) by Aiwendil on Friday January 13 2017, @10:28PM

        by Aiwendil (531) on Friday January 13 2017, @10:28PM (#453522) Journal

        Hell, I'd do an operating system before Emacs, or is that a contradiction?

        They already have redox (os written in rust), so it seems they agree on OS first ;)

      • (Score: 2) by JoeMerchant on Friday January 13 2017, @10:29PM

        by JoeMerchant (3937) on Friday January 13 2017, @10:29PM (#453526)

        I'd do an operating system before Emacs, or is that a contradiction?

        Yes.

        --
        🌻🌻 [google.com]
        • (Score: 2) by Nerdfest on Saturday January 14 2017, @01:05AM

          by Nerdfest (80) on Saturday January 14 2017, @01:05AM (#453650)

          Thanks. This is why I come here. Well, that and the abuse.

      • (Score: 1, Insightful) by Anonymous Coward on Saturday January 14 2017, @01:18AM

        by Anonymous Coward on Saturday January 14 2017, @01:18AM (#453655)

        Rust hipsters are the last people who should be writing security software. You're gonna end up with plenty of different bugs in the original code that they'll imtroduce.

    • (Score: 2) by maxwell demon on Saturday January 14 2017, @05:54AM

      by maxwell demon (1608) on Saturday January 14 2017, @05:54AM (#453720) Journal

      Because it's old. Old things tend to Rust if you don't explicitly protect against it, didn't you know that?

      --
      The Tao of math: The numbers you can count are not the real numbers.
  • (Score: 2) by hendrikboom on Friday January 13 2017, @10:28PM

    by hendrikboom (1125) Subscriber Badge on Friday January 13 2017, @10:28PM (#453523) Homepage Journal

    While you are at it, consider working on making lexical scoping the default, and inserting static type checking in elisp, to further banish bugs.

    Of course you will still need a compatible legacy mode for old elisp code, which you seem to want to still support.

    Perhaps the best way forward is to use a typed Scheme implementation (something like typed Racket), and add a legacy mode to it. I have the impression that this is the direction that emacs has wanted to take for a while now.

    A for implementing typed Scheme in typed Rust, ideally they should be nicely interoperable. Maybe something like Gambit, which compiles Scheme to C or C++ could translate Scheme to Rust?

    In fact with such a translation system, you could code emacs in a mix of Rust and Scheme, using Scheme as an interpreted, but compilable, scripting language.

    Doing this would advance the state of the art, instead of just retrofitting it.

    • (Score: 2) by Marand on Saturday January 14 2017, @12:38AM

      by Marand (1081) on Saturday January 14 2017, @12:38AM (#453631) Journal

      While you are at it, consider working on making lexical scoping the default, and inserting static type checking in elisp, to further banish bugs.

      Can't do that without breaking compatibility with everything, though. You can already set lexical scoping in a couple ways, and it's encouraged I believe, but it's not something you could just flip a switch on for everything without potentially breaking a lot of code. To do something drastic like that you'd need do a Perl5|6 or Python2|3 type split, essentially freezing the current elisp so that existing code keeps working while encouraging people to move to writing .el2 files or something.

      Though if you're going to do that you may as well go with a completely different, and less shitty, lisp. Preferably a lisp-1 of some kind, such as a Scheme dialect. With some sort of proper fucking regex literal, too; that "\\\\\\\\\\\\\foo" nonsense gets ridiculous. I could keep going, I don't like elisp very much...

      • (Score: 0) by Anonymous Coward on Saturday January 14 2017, @12:55PM

        by Anonymous Coward on Saturday January 14 2017, @12:55PM (#453774)

        The long-standing plan is to replace elisp with Guile [gnu.org], which is the GNU implementation of Scheme, once it has matured enough to have a fully-compatible elisp mode. A quick search shows that you can build the current version of this so-call GuileEmacs from here [emacswiki.org].

    • (Score: 2) by darkfeline on Saturday January 14 2017, @10:26PM

      by darkfeline (1030) on Saturday January 14 2017, @10:26PM (#453932) Homepage

      Static type checking isn't very useful in elisp since the type of almost everything is going to be "cons" and there's no good way to declare static types for all of the ways cons are used (an alist can also be a valid plist, can be a valid list, can be a valid list of lists, can be a valid list of cons, etc)

      --
      Join the SDF Public Access UNIX System today!
  • (Score: 0) by Anonymous Coward on Friday January 13 2017, @11:37PM

    by Anonymous Coward on Friday January 13 2017, @11:37PM (#453579)

    so now the realty company is branching into hipster kodester.

  • (Score: 2) by FatPhil on Friday January 13 2017, @11:49PM

    by FatPhil (863) <reversethis-{if.fdsa} {ta} {tnelyos-cp}> on Friday January 13 2017, @11:49PM (#453596) Homepage
    "writing your first elisp function using Rust."

    That makes no sense - you write elisp functions in elisp, otherwise, they're *not elisp functions*?!?!?
    --
    Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
    • (Score: 2) by Marand on Saturday January 14 2017, @12:25AM

      by Marand (1081) on Saturday January 14 2017, @12:25AM (#453620) Journal

      That makes no sense - you write elisp functions in elisp, otherwise, they're *not elisp functions*?!?!?

      It's an elisp function in the sense that it's created to be used from elisp, but created in the underlying langauge (normally C, or Rust in this thing's case). For another example of this, look at Lua, which is frequently embedded in software such as games, which results in a similar situation: Lua functions that were implemented in whatever language it was embedded into. So, it sounds like they're requesting help converting elisp-callable functions that were implemented in C.

      One interesting thing about lisps is, once you have a few primitives, you can implement the rest of the language with the lisp itself... however, they always seem to implement more than the minimum necessary in the "parent" language, presumably for performance reasons. With a codebase as old as emacs, there's probably a lot of code like that lying around.

      • (Score: 2) by FatPhil on Sunday January 15 2017, @01:14PM

        by FatPhil (863) <reversethis-{if.fdsa} {ta} {tnelyos-cp}> on Sunday January 15 2017, @01:14PM (#454066) Homepage
        Those aren't elisp/lua functions, those are elisp/lua primitives.
        --
        Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
        • (Score: 2) by Marand on Sunday January 15 2017, @09:02PM

          by Marand (1081) on Sunday January 15 2017, @09:02PM (#454164) Journal

          Seriously? I'm aware they're primitives -- I called them that in my comment in fact -- but it's usually not worth making the distinction explicitly. I made a good-faith attempt to explain what they likely meant because I thought it might be a legitimate question instead of smart-assed pedantry, but your follow-up indicates I was mistaken. Now you're just nitpicking in a desperate attempt to correct me.

          • (Score: 2) by FatPhil on Monday January 16 2017, @01:00AM

            by FatPhil (863) <reversethis-{if.fdsa} {ta} {tnelyos-cp}> on Monday January 16 2017, @01:00AM (#454213) Homepage
            I was attempting to point out that *they* come over as ignoramuses, nothing more.
            --
            Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
    • (Score: 2) by rufty on Saturday January 14 2017, @01:11PM

      by rufty (381) on Saturday January 14 2017, @01:11PM (#453777)
      To make real sense you'd have to do that in fortran [mit.edu].