Os Grupos Google já não suportam novas publicações ou subscrições da Usenet. O conteúdo anterior permanece visível.
Dismiss

tiny editor written in common lisp?

158 visualizações
Ir para a primeira mensagem não lida

Jinsong Zhao

não lida,
17/04/2022, 04:34:1317/04/22
para
Hi there,

Is there any tiny editor (the smaller, the better) that is written in
Common Lisp?

Thanks a lot.

Best,
Jinsong

Jason McBrayer

não lida,
17/04/2022, 13:51:2617/04/22
para
Jinsong Zhao <jsz...@yeah.net> writes:

> Hi there,
>
> Is there any tiny editor (the smaller, the better) that is written in
> Common Lisp?

Have you looked at the "Awesome Common Lisp Applications" lisp?

https://github.com/azzamsa/awesome-cl-software#editors

--
Jason McBrayer | “Strange is the night where black stars rise,
jmc...@carcosa.net | and strange moons circle through the skies,
| but stranger still is lost Carcosa.”
| ― Robert W. Chambers,The King in Yellow

Peri Didaskalou

não lida,
17/04/2022, 15:09:2017/04/22
para
Hi Jinsong,

By 'tiny' do you mean an editor written in CL, which is like a text
editor only, without a built-in REPL, as SLIME and SLY provide within
Emacs and Emacs variants?

If you're willing to learn and use CMUCL, it has Hemlock, and, Robert
Strandh, is onto his 'Second Climacs'
https://github.com/robert-strandh/Second-Climacs

Are you asking because you'd like to investigate building upon such a
'tiny editor' in CL? If so, perhaps you can fork and work on 'Second
Climacs'

If 98.4% written in CL is good enough, take a look at lem
https://github.com/lem-project/lem

Cheers,
Peri


Peri Didaskalou

não lida,
17/04/2022, 15:11:2117/04/22
para
On 2022-04-17 4:34 a.m., Jinsong Zhao wrote:

Jinsong Zhao

não lida,
18/04/2022, 04:59:1118/04/22
para
On 2022/4/18 1:51, Jason McBrayer wrote:
> Jinsong Zhao <jsz...@yeah.net> writes:
>
>> Hi there,
>>
>> Is there any tiny editor (the smaller, the better) that is written in
>> Common Lisp?
>
> Have you looked at the "Awesome Common Lisp Applications" lisp?
>
> https://github.com/azzamsa/awesome-cl-software#editors
>

Thanks for the information. It's great to know so many awesome cl
applications.

Best,
Jinsong

Jinsong Zhao

não lida,
18/04/2022, 05:12:0718/04/22
para
Hi Peri,

Thanks for pointing me to those editors. I am asking because I'd like to
learn how to write a real application using CL. I also don't have such
experience in CL and other language. Therefore, a tiny editor, which
just does some basic text manipulation, may simple enough for me to
understand. I found ABLE (https://able.common-lisp.dev/), however, I
haven't had time to read and understand it yet.

Best,
Jinsong


Peri Didaskalou

não lida,
18/04/2022, 08:40:5018/04/22
para
Hi Jinsong,

Oh, OK. Best of luck with GUI frameworks/toolkitss and such, in this regard.
Thanks for reminding me about able. As you can see, able's GUI
component(s) are TCL/TK based.

Second-Climacs uses the open-source version of CLIM caleed McCLIM, in
case you haven't noticed yet. https://github.com/McCLIM/McCLIM .

BTW, there's a #commonlisp channel at https://web.libera.chat, where
you'll also find Robert Strandh's #sicl channel.

Also, if you're interested in writing and compiling APL to/within Common
Lisp, check out APRIL: https://github.com/phantomics/april and the
##phantomics channel at libera.chat too!

Best,
Peri



Axel Reichert

não lida,
18/04/2022, 08:57:5418/04/22
para
Jinsong Zhao <jsz...@yeah.net> writes:

> Is there any tiny editor (the smaller, the better) that is written in
> Common Lisp?

A couple of things came to my mind, all only tangentially related to
your question:

https://github.com/hughbarney

https://www.buildyourownlisp.com/

https://web.mit.edu/~yandros/doc/craft-text-editing/index.html

So here is the rub: Hugh Barney has written a couple of very small
emacs-like editors, some even extensible with a small Lisp. These
editors are however written in C. In comes the second link, a nice
little project to learn C and Lisp in a combined way. And finally an
article about implementations, e.g. the gap buffer/buffer gap used in
the tiny editors from above.

Yes, it is a rather lengthy detour to your original goal, but to me it
sounds like a rounded project.

Best regards

Axel

Jeff Barnett

não lida,
18/04/2022, 14:39:0018/04/22
para
Doing the string manipulations and processing operations will be
straightforward but very time consuming. What will take what seems like
forever is screen (window) management. If you just want to do the first
part, look at the old TECO editor as an example. I believe EMACS was
inspired by it a zillion years ago. I'm pretty sure that someone in this
mail group will have a pointer handy if you are interested; I don't.
--
Jeff Barnett

Steve G

não lida,
25/05/2022, 08:29:2825/05/22
para
Jeff Barnett <j...@notatt.com> writes:

> On 4/18/2022 3:11 AM, Jinsong Zhao wrote:
>> On 2022/4/18 3:11, Peri Didaskalou wrote:
>>> On 2022-04-17 4:34 a.m., Jinsong Zhao wrote:
>>>> Hi there,
>>>>
>>>> Is there any tiny editor (the smaller, the better) that is written in
>>>> Common Lisp?
>>>>
>>>> Thanks a lot.
>>>>
>>>> Best,
>>>> Jinsong

[ ... ]


> look at the old TECO editor as an example. I believe EMACS was inspired by it
> a zillion years ago. I'm pretty sure that someone in this mail group will have
> a pointer handy if you are interested; I don't.

Yes, if I remeber correctly RMS wrote emacs in TECO. I remeber reading
the code on tape. I do not recommend trying to understand it.

Steve G

não lida,
25/05/2022, 08:50:1925/05/22
para
Jinsong Zhao <jsz...@yeah.net> writes:

> Hi there,
>
> Is there any tiny editor (the smaller, the better) that is written in Common
> Lisp?


I have written a terminfo to lisp code compiler. I was trying to
implement a readline like interface to terminfo for the ED function.
Unfortunately I got interrupted again. Let me know if your interested.
It is only ~ 2000 lines :)

I am trying to figure out how to implement the buffer. I would like fast
searching so a gap buffer would be better than a line structure.

I started it out as a rule/planning system to implement the best
possible sequences - the rule engine is too slow for practical use but
it is very fun to play with.

I have a working version that uses linux kernel keysyms. I am
struggling with signals and intervals for text highlighting.

Anyone have a solution for intervals. I was thinking to use displaced
arrays.

The other problem is unicode. I do not understand this. I planned on
just supporting the 96 letters in common lisp.

The rules are simple, they look like:

(define-motion ("cursor_home") (curscr)
(cm-cursor-save-xy curscr)
(setf (screen-cur-x curscr) (screen-beg-x curscr))
(setf (screen-cur-y curscr) (screen-beg-y curscr))
(output-cond! ((=> "home"))
((=> "cup") (output-sequence! "cup" (screen-beg-x curscr) (screen-beg-y curscr)))))

.

After the terminal definition is loaded it expands the rule into the following.

(PROGN
(DEFUN CM-CURSOR-HOME ()
"[cursor_home;home;ho]: home cursor (if no cup)"
(DECLARE
(OPTIMIZE SPEED (SAFETY 1) (DEBUG 2) (SPACE 0) (COMPILATION-SPEED 0)))
(LET ((CURSCR (CURRENT-SCREEN)))
(DECLARE (SCREEN CURSCR))
(CM-CURSOR-SAVE-XY CURSCR)
(SETF (SCREEN-CUR-X CURSCR) (SCREEN-BEG-X CURSCR))
(SETF (SCREEN-CUR-Y CURSCR) (SCREEN-BEG-Y CURSCR))
(BLOCK #:CURSOR-HOME
(LOCALLY
(DECLARE
(OPTIMIZE SPEED (SPACE 0) (DEBUG 3) (SAFETY 3) (COMPILATION-SPEED 0)))
(SB-UNIX:UNIX-WRITE (SCREEN-OFD CURSCR) "\E[H" 0 3)
T))))
(PUSHNEW 'CM-CURSOR-HOME *CM-FUNCTIONS* :TEST #'EQ))

I wanted to use it for goal planning - but this would be far to slow for
a read text editor.

I am using it across virtual terminals successfully. The buffering is a
pain. It also implements termios so that you can set the read to 4 bytes
UTF8.

If you have an example that is simple I would love to hear more.
0 mensagens novas