def-gthill / lexurgy

A high-powered sound change applier
GNU General Public License v3.0
42 stars 5 forks source link

Lexurgy Daemon / Server #67

Closed neta-elad closed 1 year ago

neta-elad commented 1 year ago

Hey Graham, this is an idea I've been starting to play around with, but I wanted to discuss before I go any further beyond the prototype implementation I have now:

I'm working on a tool which is (among other things) an interactive environment to run Lexurgy. The use case is:

I've noticed that running Lexurgy is a bit slow (even though running the sound changes themselves is pretty fast). I've attributed this to two factors:

  1. Loading up the JVM
  2. Parsing the sound change file

Both of these need not happen for every query, so I've been working on a "lexurgy server" mode, which loads up a sound change file and then stays alive, waiting for queries from stdin. I also have a hacky syntax, so that queries that start with ; after=<after>,before=<before>,tracing=<tracing> will change the state of the server, so that the following queries will use these settings.

I don't think this is a great a system, but I was hoping to get some feedback from you, if this sounds like something you would be willing to incorporate into Lexurgy. (If you want to see the ugly, hacky code I have now, it's here.)

Thanks!

(N.B. this has nothing to do with the PR I opened)

def-gthill commented 1 year ago

I ran into the same problem when I was working on a similar Python tool. I ended up doing a bunch of fancy processing to try to batch together as many Lexurgy calls as possible... for some reason it didn't occur to me to modify Lexurgy to run continuously like this!

So I like the idea; feel free to keep working on it and PR it when you're happy with it!