unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* making software with Emacs and Elisp
@ 2013-10-20  0:17 Emanuel Berg
  2013-10-20  1:42 ` Pascal J. Bourguignon
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Emanuel Berg @ 2013-10-20  0:17 UTC (permalink / raw)
  To: help-gnu-emacs

I have several ideas for software that has to do with
physical things, and does not belong in the world of
computing. For example, I'm working on a tool to teach
deaf people read lips! (Not "Lisp".)

Is there a minimal binary Emacs VM for the accursed
Apple and Windows world, that you could distribute along
with the software, or is there another way you could
make all that work?

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
@ 2013-10-20  1:00 Barry OReilly
  0 siblings, 0 replies; 17+ messages in thread
From: Barry OReilly @ 2013-10-20  1:00 UTC (permalink / raw)
  To: help-gnu-emacs

> I have several ideas for software that has to do with physical
> things, and does not belong in the world of computing. For example,
> I'm working on a tool to teach deaf people read lips! (Not "Lisp".)
>
> Is there a minimal binary Emacs VM for the accursed Apple and
> Windows world, that you could distribute along with the software, or
> is there another way you could make all that work?

Having an Emacs that can run outside the world of computing could be
difficult. You could start by looking at the butterfly function
though.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
       [not found] <mailman.4327.1382230827.10748.help-gnu-emacs@gnu.org>
@ 2013-10-20  1:12 ` Emanuel Berg
  2013-10-20  1:51   ` Pascal J. Bourguignon
  0 siblings, 1 reply; 17+ messages in thread
From: Emanuel Berg @ 2013-10-20  1:12 UTC (permalink / raw)
  To: help-gnu-emacs

Barry OReilly <gundaetiapo@gmail.com> writes:

>> I have several ideas for software that has to do with
>> physical things, and does not belong in the world of
>> computing. For example, I'm working on a tool to
>> teach deaf people read lips! (Not "Lisp".)
>>
>> Is there a minimal binary Emacs VM for the accursed
>> Apple and Windows world, that you could distribute
>> along with the software, or is there another way you
>> could make all that work?
>
> Having an Emacs that can run outside the world of
> computing could be difficult.

Tools that deal with computers are ready to ship the
moment they work on your on system. But if I make a tool
for fishers, I don't demand that they are fluent in
Unix. On the contrary, I'd be happy if they use my
software on whatever system.

> You could start by looking at the butterfly function
> though.

There *is* such a function, it seems like a joke though.

Unless I'm wrong, your post wasn't helpful.

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-20  1:42 ` Pascal J. Bourguignon
@ 2013-10-20  1:36   ` Emanuel Berg
  0 siblings, 0 replies; 17+ messages in thread
From: Emanuel Berg @ 2013-10-20  1:36 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> The binary is only 13MB (about 8MB on a 32-bit system
> IIRC).  You could prefectly use only that.  You can
> try it with the -Q option:
>
>     emacs -Q
>
> and see what's left of the emacs user experience with
> it.

Yeah, I know.

> You could indeed develop an application on this bare
> emacs, but this would be equivalent to develop an
> application on a bare Linux kernel with only a shell
> and gcc installed.  You can write an ed-like editor in
> bash, and soon enough be editing programs to be
> compiled with gcc.  Perhaps the first program you'd
> write would be a lisp interpreter in which to write an
> emacs... But soon after that, you'll gather libraries
> to be able to write higher level programs.

You are right, might as well ship the whole thing (or
provide references). Some people will be put off by
that, and some people will mess it up, but you can never
make everything work for everyone anyway.

> To compare with little applications in the accursed
> Apple world

Crazy stuff.

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-20  0:17 Emanuel Berg
@ 2013-10-20  1:42 ` Pascal J. Bourguignon
  2013-10-20  1:36   ` Emanuel Berg
  2013-10-20  9:15 ` Marcin Borkowski
       [not found] ` <mailman.4335.1382260532.10748.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 17+ messages in thread
From: Pascal J. Bourguignon @ 2013-10-20  1:42 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> I have several ideas for software that has to do with
> physical things, and does not belong in the world of
> computing. For example, I'm working on a tool to teach
> deaf people read lips! (Not "Lisp".)
>
> Is there a minimal binary Emacs VM for the accursed
> Apple and Windows world, that you could distribute along
> with the software, or is there another way you could
> make all that work?

There are binaries of emacs for MacOSX, MS-Windows and various unices
including GNU systems.

In general, an installation of emacs includes the emacs executable, plus
a set of compiled emacs lisp libraries (.elc files in /usr/share/emacs/).
Usually, there are also the source .el files.

There are also a few auxiliary programs in /usr/lib/emacs (movemail,
hexl, etc).

On a 64-bit system:

$ du -shc /usr/share/emacs/24.2/ /usr/lib/emacs/24.2/ /usr/bin/emacs24-x 
69M	/usr/share/emacs/24.2/
96K	/usr/lib/emacs/24.2/
13M	/usr/bin/emacs24-x
82M	total


The binary is only 13MB (about 8MB on a 32-bit system IIRC).
You could prefectly use only that.  You can try it with the -Q option:

    emacs -Q

and see what's left of the emacs user experience with it.

You could indeed develop an application on this bare emacs, but this
would be equivalent to develop an application on a bare Linux kernel
with only a shell and gcc installed.  You can write an ed-like editor in
bash, and soon enough be editing programs to be compiled with gcc.
Perhaps the first program you'd write would be a lisp interpreter in
which to write an emacs… But soon after that, you'll gather libraries to
be able to write higher level programs.  


To compare with little applications in the accursed Apple world:

428M    NeoOffice.app
346M    iWeb.app
225M    iTunes.app
177M    iPhoto.app
176M    GarageBand.app
158M    XBMC.app
141M    Coqide.app
139M    VLC.app
139M    Second Life Viewer 2.app
136M    DXOOpticsPro8.app
133M    Emacs.app
126M    Aquamacs.app
123M    iDVD.app
121M    Wireshark.app
115M    iMovie.app
103M    Firefox.app
--------------------------------> emacs 24.2 with everything
 67M    SeaMonkey.app
 64M    Skype.app
 56M    Camino.app
 54M    Mail.app
 53M    VLCStreamer.app
 53M    Firefox3.app
 52M    Coda.app
 51M    Thunderbird.app
 48M    SuperTrainsFree.app
 45M    Dropbox.app
 43M    Preview.app
 38M    iCal.app
 36M    Clozure CL.app
 31M    Safari.app
 31M    QuickTime Player.app
 30M    iChat.app
 22M    Photo Booth.app
 21M    Address Book.app
 20M    Plane Control Lite.app
 18M    ArgoUML.app
 16M    DivX Player.app
 ------------------------------> /usr/bin/emacs24-x
 13M    FaceTime.app
 12M    Nokia Multimedia Transfer.app
 11M    Font Book.app
 10M    DVD Player.app
 10M    Automator.app
 10M    App Store.app


So I don't see what you would earn, in preventing yourself to use the
*.elc libraries provided with emacs in your emacs application.

Unless you like to fight with both hands tied in the back.


-- 
__Pascal Bourguignon__
http://www.informatimago.com/


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-20  1:12 ` making software with Emacs and Elisp Emanuel Berg
@ 2013-10-20  1:51   ` Pascal J. Bourguignon
  0 siblings, 0 replies; 17+ messages in thread
From: Pascal J. Bourguignon @ 2013-10-20  1:51 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> Barry OReilly <gundaetiapo@gmail.com> writes:
>
>>> I have several ideas for software that has to do with
>>> physical things, and does not belong in the world of
>>> computing. For example, I'm working on a tool to
>>> teach deaf people read lips! (Not "Lisp".)
>>>
>>> Is there a minimal binary Emacs VM for the accursed
>>> Apple and Windows world, that you could distribute
>>> along with the software, or is there another way you
>>> could make all that work?
>>
>> Having an Emacs that can run outside the world of
>> computing could be difficult.
>
> Tools that deal with computers are ready to ship the
> moment they work on your on system. But if I make a tool
> for fishers, I don't demand that they are fluent in
> Unix. On the contrary, I'd be happy if they use my
> software on whatever system.
>
>> You could start by looking at the butterfly function
>> though.
>
> There *is* such a function, it seems like a joke though.
>
> Unless I'm wrong, your post wasn't helpful.

Well perhaps nobody implemented a M-x butterfly backend.
But there are emacs backends for several commands with physical world
effects, including M-x coffee  (implementing the htcpcp protocol) and
teledildonics.

http://www.emacswiki.org/emacs/CoffeeMode
http://www.youtube.com/watch?v=D1sXuHnf_lo

-- 
__Pascal Bourguignon__
http://www.informatimago.com/




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-20  0:17 Emanuel Berg
  2013-10-20  1:42 ` Pascal J. Bourguignon
@ 2013-10-20  9:15 ` Marcin Borkowski
  2013-10-20 12:40   ` Pascal J. Bourguignon
       [not found] ` <mailman.4335.1382260532.10748.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 17+ messages in thread
From: Marcin Borkowski @ 2013-10-20  9:15 UTC (permalink / raw)
  To: help-gnu-emacs

Dnia 2013-10-20, o godz. 02:17:35
Emanuel Berg <embe8573@student.uu.se> napisał(a):

> I have several ideas for software that has to do with
> physical things, and does not belong in the world of
> computing. For example, I'm working on a tool to teach
> deaf people read lips! (Not "Lisp".)
> 
> Is there a minimal binary Emacs VM for the accursed
> Apple and Windows world, that you could distribute along
> with the software, or is there another way you could
> make all that work?

I understand that you want to develop your application in "EmacsOS";),
that is, using Emacs as a "operating system" or "framework" or "virtual
machine" (or whatever is the current buzzword at the moment), so that
you get high portability (without Java etc.).

One thing that comes to mind is Clojure (with which I have zero
experience), but it gives you the benefits of Lisp, of portability (at
least as much as Java does) and of libraries (read JVM).

And, did you see this: http://www.emacswiki.org/emacs/EmacsPortableApp ?

Hth,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-20  9:15 ` Marcin Borkowski
@ 2013-10-20 12:40   ` Pascal J. Bourguignon
  0 siblings, 0 replies; 17+ messages in thread
From: Pascal J. Bourguignon @ 2013-10-20 12:40 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Dnia 2013-10-20, o godz. 02:17:35
> Emanuel Berg <embe8573@student.uu.se> napisał(a):
>
>> I have several ideas for software that has to do with
>> physical things, and does not belong in the world of
>> computing. For example, I'm working on a tool to teach
>> deaf people read lips! (Not "Lisp".)
>> 
>> Is there a minimal binary Emacs VM for the accursed
>> Apple and Windows world, that you could distribute along
>> with the software, or is there another way you could
>> make all that work?
>
> I understand that you want to develop your application in "EmacsOS";),
> that is, using Emacs as a "operating system" or "framework" or "virtual
> machine" (or whatever is the current buzzword at the moment), so that
> you get high portability (without Java etc.).

You forgot "textual user interface".

> One thing that comes to mind is Clojure (with which I have zero
> experience), but it gives you the benefits of Lisp, of portability (at
> least as much as Java does) and of libraries (read JVM).

And this is what clojure and java don't have.
A good alternative would be the Oberon system in a virtual machine.
http://www.oberon.ethz.ch/downloads/index

> And, did you see this: http://www.emacswiki.org/emacs/EmacsPortableApp ?
>
> Hth,

-- 
__Pascal Bourguignon__
http://www.informatimago.com/




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
       [not found] ` <mailman.4335.1382260532.10748.help-gnu-emacs@gnu.org>
@ 2013-10-22 23:00   ` Emanuel Berg
  2013-10-22 23:29     ` Marcin Borkowski
                       ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Emanuel Berg @ 2013-10-22 23:00 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> I understand that you want to develop your application
> in "EmacsOS"

You are actually the *third* person who brought up the
"OS" aspect with me. I never thought of Emacs that way.

Well, it isn't like the Linux kernel because it is
interactive, and it doesn't access and allocate hardware
to a pool of processes. For example, if you run a shell
command from Emacs, that is continuous/background in
character, isn't that run next to Emacs, with the kernel
doing the multitasking, rather than on top of Emacs, and
Emacs doing the scheduling etc.?

But you may also include other stuff in a definition of
"OS", like the libraries, the tools, the interface... In
that sense I agree Emacs is very much an OS, perhaps
even the best there is!

But (in the kernel "OS" interpretation), that's overkill
for my purposes, I don't need to spawn processes/threads
and all that, I just need to be able to execute my Elisp
software elsewhere, the same way it is executed on my
machine.

Doesn't for example Python code work everywhere, as long
as you have a Python interpreter? (I never did Python.)
Something like that would be enough, and I suppose the
Elisp interpreter is... Emacs.

> One thing that comes to mind is Clojure (with which I
> have zero experience), but it gives you the benefits
> of Lisp, of portability (at least as much as Java
> does) and of libraries (read JVM).

Yeah, I'm not doing Java, and as for Clojure, I don't
feel like learning anything brand new at the moment. You
could easily do that you entire life (learn new
things). Right now, I'm more into doing something with
what I know right now.

There are so many Lisp dialects. I what way is Clojure
more portable?

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-22 23:00   ` Emanuel Berg
@ 2013-10-22 23:29     ` Marcin Borkowski
  2013-10-23  0:36     ` Pascal J. Bourguignon
       [not found]     ` <mailman.4507.1382488595.10748.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 17+ messages in thread
From: Marcin Borkowski @ 2013-10-22 23:29 UTC (permalink / raw)
  To: help-gnu-emacs

Dnia 2013-10-23, o godz. 01:00:21
Emanuel Berg <embe8573@student.uu.se> napisał(a):

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
> 
> > I understand that you want to develop your application
> > in "EmacsOS"
> 
> You are actually the *third* person who brought up the
> "OS" aspect with me. I never thought of Emacs that way.

I had to - most of my friend use Vim, and Emacs being an OS is a
recurring joke of them (see below).

> Well, it isn't like the Linux kernel because it is
> interactive, and it doesn't access and allocate hardware
> to a pool of processes. For example, if you run a shell
> command from Emacs, that is continuous/background in
> character, isn't that run next to Emacs, with the kernel
> doing the multitasking, rather than on top of Emacs, and
> Emacs doing the scheduling etc.?
> 
> But you may also include other stuff in a definition of
> "OS", like the libraries, the tools, the interface... In
> that sense I agree Emacs is very much an OS, perhaps
> even the best there is!

Yes.  More of a window manager, or desktop environment than OS.  (But
remember the old joke: "Emacs is actually a nice OS, it only lacks a
decent ASCII editor."  NB.: each time I'm told this joke, I reply with
this one: "Why are Vim users so egocentric?  Because they begin each
sentence with `I'.")
 
> But (in the kernel "OS" interpretation), that's overkill
> for my purposes, I don't need to spawn processes/threads
> and all that, I just need to be able to execute my Elisp
> software elsewhere, the same way it is executed on my
> machine.

True.

> Doesn't for example Python code work everywhere, as long
> as you have a Python interpreter? (I never did Python.)
> Something like that would be enough, and I suppose the
> Elisp interpreter is... Emacs.

Yes, but in Emacs you get the UI for free, with all the nice
editing stuff.  (Probably Python with GTK or Qt or whatever is a rough
equivalent - well, minus the nice editing stuff, of course.)

> > One thing that comes to mind is Clojure (with which I
> > have zero experience), but it gives you the benefits
> > of Lisp, of portability (at least as much as Java
> > does) and of libraries (read JVM).
> 
> Yeah, I'm not doing Java, and as for Clojure, I don't
> feel like learning anything brand new at the moment. You
> could easily do that you entire life (learn new
> things). Right now, I'm more into doing something with
> what I know right now.

Understood.

> There are so many Lisp dialects. I what way is Clojure
> more portable?

It compiles to Java bytecode.  And you have access to Java libraries.
(But again, maybe one should beware of Java.  As another joke says:
Someone had a problem, and decided to use Java.  Now he has a
ProblemFactory.)

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-22 23:00   ` Emanuel Berg
  2013-10-22 23:29     ` Marcin Borkowski
@ 2013-10-23  0:36     ` Pascal J. Bourguignon
       [not found]     ` <mailman.4507.1382488595.10748.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 17+ messages in thread
From: Pascal J. Bourguignon @ 2013-10-23  0:36 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>
>> I understand that you want to develop your application
>> in "EmacsOS"
>
> You are actually the *third* person who brought up the
> "OS" aspect with me. I never thought of Emacs that way.
>
> Well, it isn't like the Linux kernel because it is
> interactive, and it doesn't access and allocate hardware
> to a pool of processes. For example, if you run a shell
> command from Emacs, that is continuous/background in
> character, isn't that run next to Emacs, with the kernel
> doing the multitasking, rather than on top of Emacs, and
> Emacs doing the scheduling etc.?

cf. the process objects.

emacs does manage memory, or schedule processor time for the various
functions running in emacs.

Also, "Operating System" doesn't mean unix-like architecture.  You can
have very different architectures.


> But you may also include other stuff in a definition of
> "OS", like the libraries, the tools, the interface... In
> that sense I agree Emacs is very much an OS, perhaps
> even the best there is!


Indeed, an OS is not a kernel.  
cf. GNU vs. Linux, or GNU vs. Hurd.
cf. emacs vs. Linux http://informatimago.com/linux/emacs-on-user-mode-linux.html


> But (in the kernel "OS" interpretation), that's overkill
> for my purposes, I don't need to spawn processes/threads
> and all that, I just need to be able to execute my Elisp
> software elsewhere, the same way it is executed on my
> machine.
>
> Doesn't for example Python code work everywhere, as long
> as you have a Python interpreter? 

No it doesn't.  There are a lot of versions of python, and python
libraries may or may not work on several of those versions.
Distributions usually package them so that several versions can be
installed at the same time, and a python program chooses one version or
another to run.  The same is true for ruby (with even a specific tools
to setup the environment with a given ruby version and gem
configuartion, cf. rvm).


Some implementations also can install different versions of emacs.
(cf. gentoo eselect, /etc/alternatives on ubuntu, etc).


> Something like that would be enough, and I suppose the
> Elisp interpreter is... Emacs.

That said, there's less differences between (consecutive) versions of
emacs than in the case of ruby or python, and it's easier to write a
program that can run on different versions of emacs lisp.

As long as emacs is installed (it may be a dependency of your program,
so it gets installed automatically in a given distribtion package
management system), you can run your program with:

    $ emacs -Q --batch -l myprogram.el

you can provide a script to launch your program such as:

    $ cat myprogram
    #!/bin/sh
    exec emacs -Q --batch -l myprogram.el
    $


-- 
__Pascal Bourguignon__
http://www.informatimago.com/




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
       [not found]     ` <mailman.4507.1382488595.10748.help-gnu-emacs@gnu.org>
@ 2013-10-24 19:57       ` Emanuel Berg
  2013-10-24 22:00         ` Pascal J. Bourguignon
  0 siblings, 1 reply; 17+ messages in thread
From: Emanuel Berg @ 2013-10-24 19:57 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> emacs does manage memory, or schedule processor time
> for the various functions running in emacs.

So it does? Then it *is* an OS within the OS, at the
very least, like a Chinese box or those Russian
dolls. But - when does this happen? And how is it done?
For example, if I write an interactive defun, I always
thought that was executed sequentially upon
invocation. Is that so?  And, how do I code a defun that
is interactive in the sense it can be invoked by the
user, but "batch" in the sense that it is run in the
background, perhaps as an infinite loop? And if I make
two such defuns, can I give them different priorities,
and otherwise like the PCBs of a "real" OS, to setup how
they should relate to everything else?

> Also, "Operating System" doesn't mean unix-like
> architecture.  You can have very different
> architectures.

Yeah, I guess that's just a schoolbook issue anyway.

> $ emacs -Q --batch -l myprogram.el
> ...
>     $ cat myprogram
>     #!/bin/sh
>     exec emacs -Q --batch -l myprogram.el

Great!

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-24 19:57       ` Emanuel Berg
@ 2013-10-24 22:00         ` Pascal J. Bourguignon
  2013-10-24 22:24           ` Emanuel Berg
  0 siblings, 1 reply; 17+ messages in thread
From: Pascal J. Bourguignon @ 2013-10-24 22:00 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
>> emacs does manage memory, or schedule processor time
>> for the various functions running in emacs.
>
> So it does? Then it *is* an OS within the OS, at the
> very least, like a Chinese box or those Russian
> dolls. 

Indeed.


> But - when does this happen? 
> And how is it done?


> For example, if I write an interactive defun, I always
> thought that was executed sequentially upon
> invocation. Is that so?  And, how do I code a defun that
> is interactive in the sense it can be invoked by the
> user, but "batch" in the sense that it is run in the
> background, perhaps as an infinite loop? And if I make
> two such defuns, can I give them different priorities,
> and otherwise like the PCBs of a "real" OS, to setup how
> they should relate to everything else?

If you want to run processes in the outer system you can call
start-process amongst a few other functions.


But you can have code scheduled to run in emacs.  It is not a preemptive
system, but a collaborative one, where each task must release the CPU
quickly enough for the rest of the system to stay responsive.  But a lot
of tasks are scheduled this way in emacs (eg. background font-locking,
semantic incremental parses, etc). See: run-with-idle-timer


Things like priorities or "how things relate to everything else" are
notions specific to a given system.  Eg. emacs run-with-idle-timer
doesn't deal with priorities, only with timing. 


>> Also, "Operating System" doesn't mean unix-like
>> architecture.  You can have very different
>> architectures.
>
> Yeah, I guess that's just a schoolbook issue anyway.
>
>> $ emacs -Q --batch -l myprogram.el
>> ...
>>     $ cat myprogram
>>     #!/bin/sh
>>     exec emacs -Q --batch -l myprogram.el
>
> Great!

-- 
__Pascal Bourguignon__
http://www.informatimago.com/


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-24 22:00         ` Pascal J. Bourguignon
@ 2013-10-24 22:24           ` Emanuel Berg
  2013-10-24 22:34             ` Pascal J. Bourguignon
       [not found]             ` <mailman.4647.1382654123.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 17+ messages in thread
From: Emanuel Berg @ 2013-10-24 22:24 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> If you want to run processes in the outer system you
> can call start-process amongst a few other functions.

No, I meant "Emacs processes" but you answered that with
`run-with-idle-timer', I guess.

> But you can have code scheduled to run in emacs.  It
> is not a preemptive system, but a collaborative one,
> where each task must release the CPU quickly enough
> for the rest of the system to stay responsive.  But a
> lot of tasks are scheduled this way in emacs
> (eg. background font-locking, semantic incremental
> parses, etc). See: run-with-idle-timer

OK, so there is one *main* Emacs process running, that
might turn *idle*, I guess if you don't do anything, and
when that happens, some Emacs arbitrator looks in a pool
of background tasks that would be beneficial if they
were run, and then runs them, and then when you start to
do something again, the main Emacs process does *not*
preempt those background tasks, instead they are run to
completion, and it is assumed you (the user) won't
notice, as they should be so fast anyway?

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-24 22:24           ` Emanuel Berg
@ 2013-10-24 22:34             ` Pascal J. Bourguignon
       [not found]             ` <mailman.4647.1382654123.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 17+ messages in thread
From: Pascal J. Bourguignon @ 2013-10-24 22:34 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
>> If you want to run processes in the outer system you
>> can call start-process amongst a few other functions.
>
> No, I meant "Emacs processes" but you answered that with
> `run-with-idle-timer', I guess.
>
>> But you can have code scheduled to run in emacs.  It
>> is not a preemptive system, but a collaborative one,
>> where each task must release the CPU quickly enough
>> for the rest of the system to stay responsive.  But a
>> lot of tasks are scheduled this way in emacs
>> (eg. background font-locking, semantic incremental
>> parses, etc). See: run-with-idle-timer
>
> OK, so there is one *main* Emacs process running, 

Yes, call it the "kernel".

> that might turn *idle*, I guess if you don't do anything, and
> when that happens, some Emacs arbitrator looks in a pool
> of background tasks that would be beneficial if they
> were run, and then runs them, and then when you start to
> do something again, the main Emacs process does *not*
> preempt those background tasks, instead they are run to
> completion, and it is assumed you (the user) won't
> notice, as they should be so fast anyway?

Yes.

But actually the kernel only does that, manage the hardware to find the
next event, and process that event thru keymaps to find the function to
call.   When it has no event it calls the functions from the idle timer
queue.  You can consider the command bound to keys as outside of the
kernel, since you can change them easily and dynamically.  You cannot
change easily the event loop of the kernel.


Of course, the emacs system is not architectured like a unix system.

-- 
__Pascal Bourguignon__
http://www.informatimago.com/




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
       [not found]             ` <mailman.4647.1382654123.10748.help-gnu-emacs@gnu.org>
@ 2013-10-24 22:43               ` Emanuel Berg
  2013-10-25 19:11                 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 17+ messages in thread
From: Emanuel Berg @ 2013-10-24 22:43 UTC (permalink / raw)
  To: help-gnu-emacs

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> Of course, the emacs system is not architectured like
> a unix system.

Do I reason like it is, or is it just a very important
point to make (several times)? Or both?

This is very interesting!

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: making software with Emacs and Elisp
  2013-10-24 22:43               ` Emanuel Berg
@ 2013-10-25 19:11                 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 17+ messages in thread
From: Pascal J. Bourguignon @ 2013-10-25 19:11 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
>> Of course, the emacs system is not architectured like
>> a unix system.
>
> Do I reason like it is, or is it just a very important
> point to make (several times)? Or both?
>
> This is very interesting!

I'm glad you understand this point.  

A lot of people are surprised by non-posix-like operating systems.

-- 
__Pascal Bourguignon__
http://www.informatimago.com/


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-10-25 19:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.4327.1382230827.10748.help-gnu-emacs@gnu.org>
2013-10-20  1:12 ` making software with Emacs and Elisp Emanuel Berg
2013-10-20  1:51   ` Pascal J. Bourguignon
2013-10-20  1:00 Barry OReilly
  -- strict thread matches above, loose matches on Subject: below --
2013-10-20  0:17 Emanuel Berg
2013-10-20  1:42 ` Pascal J. Bourguignon
2013-10-20  1:36   ` Emanuel Berg
2013-10-20  9:15 ` Marcin Borkowski
2013-10-20 12:40   ` Pascal J. Bourguignon
     [not found] ` <mailman.4335.1382260532.10748.help-gnu-emacs@gnu.org>
2013-10-22 23:00   ` Emanuel Berg
2013-10-22 23:29     ` Marcin Borkowski
2013-10-23  0:36     ` Pascal J. Bourguignon
     [not found]     ` <mailman.4507.1382488595.10748.help-gnu-emacs@gnu.org>
2013-10-24 19:57       ` Emanuel Berg
2013-10-24 22:00         ` Pascal J. Bourguignon
2013-10-24 22:24           ` Emanuel Berg
2013-10-24 22:34             ` Pascal J. Bourguignon
     [not found]             ` <mailman.4647.1382654123.10748.help-gnu-emacs@gnu.org>
2013-10-24 22:43               ` Emanuel Berg
2013-10-25 19:11                 ` Pascal J. Bourguignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).