Live data from Hacker News

Goism – Use Go instead of Emacs Lisp inside Emacs

github.com

61–70 of 78 posts

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#61

Earlier quoted context omitted.

It is possible to emit Emacs Lisp instead of bytecode/lapcode. This was the first code generator target actually. Easier to debug, simpler to trust (for the end user) and not that hard to generate. The problem is that it is harder to implement some features of Go in terms of Emacs Lisp without going down to the virtual machine level. Best examples are arbitrary return statements (can be emulated by throw/catch) and g…

Could you implement arbitrary return with cl-block and cl-return-from?

It is technically possible, but optimal solution will require more than catch and throw (cl-lib uses them) Simple demonstration: https://pastebin.com/vXp0qPw3

Some S-expressions with `cl-return' can be rewritten to avoid the need of it (by the optimizer); not sure it covers 100% of the cases though.

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#62
post #43
post #31

Earlier quoted context omitted.

Trust me, I get it. I'm not a fan of JS for the exact stated reasons. It's fragmented and full of holes. But the way I see it, JavaScript is like today's BASIC. In a very fragmented computer market, it seemed like BASIC was the one thing that ran common between a lot of home computers in the 80s. While it's not a perfect parallel, it seems with all of the different platforms that are around today it's hard to find a…

That is actually a great comparison and a very strong argument for not using JavaScript. BASIC was big in the 1980s; where is BASIC today? Elisp code from the 1980s still runs or can be trivially ported to Emacs 25. Lisp is not a fad and Lisp never goes away.

> where is BASIC today?

On .NET, UWP and Microsoft Office macros. It even is supported by .NET Native compiler, something that F# is still WIP.

And yes, at enterprise level, there are new lines of VB.NET and VBA being written every day.

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#63
post #29

Earlier quoted context omitted.

In practice, it's close to useless. A lot of the power of Emacs comes from the homogeneity and that Emacs itself is mostly written in Emacs Lisp. There have been attempts in the past to do similar bridges to Python and Javascript IIRC, but they ended up nowhere since they didn't mesh well with the existing ecosystem. No matter how bad people think Emacs Lisp is (an incorrect impression, Emacs Lisp has improved tremen…

It's a lisp. That is enough for a lot of us to want to use another language, irrespective of how much Emacs lisp improves.

If you don't like Lisp for editor programmoing, then an editor which is literally built upon a million lines of Lisp code seems to be a very bad choice. Even providing another extension language won't make the Lisp go away.

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#64
post #62
post #43

Earlier quoted context omitted.

That is actually a great comparison and a very strong argument for not using JavaScript. BASIC was big in the 1980s; where is BASIC today? Elisp code from the 1980s still runs or can be trivially ported to Emacs 25. Lisp is not a fad and Lisp never goes away.

> where is BASIC today? On .NET, UWP and Microsoft Office macros. It even is supported by .NET Native compiler, something that F# is still WIP. And yes, at enterprise level, there are new lines of VB.NET and VBA being written every day.

I don't see much VB around these days, it was stigmatized so much that just about every shop had to convert to c# (or something else) or they went under because due to the dead sea effect. 10 years ago half of all .net jobs would be VB.net, these days it's probably under 1/10th.

But that's kind of beside the point, VB.net is nothing like the BASIC of the 80's or the 90's, it's got more in common with java.

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#65
post #64
post #62

Earlier quoted context omitted.

> where is BASIC today? On .NET, UWP and Microsoft Office macros. It even is supported by .NET Native compiler, something that F# is still WIP. And yes, at enterprise level, there are new lines of VB.NET and VBA being written every day.

I don't see much VB around these days, it was stigmatized so much that just about every shop had to convert to c# (or something else) or they went under because due to the dead sea effect. 10 years ago half of all .net jobs would be VB.net, these days it's probably under 1/10th. But that's kind of beside the point, VB.net is nothing like the BASIC of the 80's or the 90's, it's got more in common with java.

VB.NET is used a lot in life sciences for data analysis by people that know some programming, given that many places have Windows only desktop policy and the data readers happen to only have DLL or COM APIs as programming interface.

The medicine you might take, has been probably measured DRC reaction curves in some VB.NET application.

It is the surviving BASIC, the evolution of QuickBasic and Visual Basic into the .NET environment.

Regarding the 80's BASIC, GW-BASIC was probably the last one of such type of unstructured line numbered BASIC.

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#66
post #57

Earlier quoted context omitted.

You're postulating a population that are willing to take on the cognitive burden of learning Emacs but who are unwilling to do the same for ELisp. I think that's a smallish population, almost entirely composed of people who want a Scheme, probably Guile, instead (but, like me, are plugging along in Elisp in anticipation of Emacs-Guile potentially shipping before the Rapture). People who want to script in Go, Common L…

I've actually met many programmers who used Emacs but knew zero Lisp of any kind, including Emacs Lisp. They were just happy using the available goods without looking under the hood. I don't think it's that unusual. Emacs is quite popular. If even 25% of the user base coded in Lisp, it would be ... astonishing.

It's pretty easy to get started coding in elisp. You essentially start doing it every time you use any command, so there's a mapping from a manual change to scripting it.

Source: am Emacs user, have a few (not a lot) functions that I cobbled together from things I did all the time.

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#68

How does it compare to something like https://github.com/janestreet/ecaml ?

I see three main approaches for the tasks projects like ecaml and goism try to solve:

1. Use a plugin system (ecaml)

2. Transcompile to a target language (gosim and emscripten-like platforms)

3. Embed another VM inside Emacs and call its eval

There are many differences between these approaches and I am not sure one of them is objectively better as a general solution.

For the end users, all of these approaches can deliver good level of integration (they require different sets of tricks to achieve that).

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#69
post #62
post #43

Earlier quoted context omitted.

That is actually a great comparison and a very strong argument for not using JavaScript. BASIC was big in the 1980s; where is BASIC today? Elisp code from the 1980s still runs or can be trivially ported to Emacs 25. Lisp is not a fad and Lisp never goes away.

> where is BASIC today? On .NET, UWP and Microsoft Office macros. It even is supported by .NET Native compiler, something that F# is still WIP. And yes, at enterprise level, there are new lines of VB.NET and VBA being written every day.

The last time I touched BASIC was Visual Basic 6. VB.NET is a great example of my point - from what I understand it was a huge pain to move VB6 applications to VB.NET

Re: Goism – Use Go instead of Emacs Lisp inside Emacs

#70
...and write all the types (without generics) - no, thank you!

Sarcasm aside, Lisp is as much as possible well-suited for the job of text and AST processing, Emacs is one of the Lisp's "killer apps" and the second best "case study" after classic old-school AI code (PAIP).

Post reply on HN