Multiple changes:

- Move to a Python process for the LanguageLink client [fixes #1, presumably]
- Finish a first rough draft of the booklet [fixes #4]
This commit is contained in:
2022-06-11 18:43:17 +02:00
parent acded68da5
commit 6369d15e93
39 changed files with 3977 additions and 56 deletions

View File

@@ -11,26 +11,27 @@ Class {
#category : #'Carp-Processes'
}
{ #category : #accessing }
CarpProcess class >> program [
^ 'carp'
]
{ #category : #accessing }
CarpProcess class >> resolveCarpPath [
| proc |
proc := GtSubprocessWithInMemoryOutput new
command: 'which';
arguments: { 'carp' }.
arguments: { self program}.
CarpPlatform subProcessEnvironmentDictionary keysAndValuesDo: [ :key :value |
proc environmentAt: key put: value ].
proc runAndWait.
(#(0 1) includes: proc exitCode) ifFalse:
[ self error: 'Unable to request carp location' ].
[ self error: 'Unable to request', self program, ' location' ].
^ proc stdout trim asFileReference
]
{ #category : #accessing }
CarpProcess class >> resolveNodejsPath [
]
{ #category : #accessing }
CarpProcess class >> serverPath [
^ CarpPath
@@ -89,12 +90,17 @@ CarpProcess >> processArguments [
self settings serverDebugMode ifTrue:
[ args add: '--inspect' ].
args
add: (self workingDirectory / 'src/languagelink.carp') resolve fullName;
add: (self workingDirectory / self programFile) resolve fullName;
add: self settings serverSocketAddress port asString;
add: self settings clientSocketAddress port asString.
^ args
]
{ #category : #accessing }
CarpProcess >> programFile [
^ 'src/languagelink.carp'
]
{ #category : #accessing }
CarpProcess >> serverPath [
| fileReference |

View File

@@ -0,0 +1,15 @@
Class {
#name : #CarpPythonProcess,
#superclass : #CarpProcess,
#category : #'Carp-Processes'
}
{ #category : #accessing }
CarpPythonProcess class >> program [
^ 'python'
]
{ #category : #accessing }
CarpPythonProcess >> programFile [
^ 'src/languagelink.py'
]

View File

@@ -9,7 +9,7 @@ LanguageLinkSettings class >> carpDefaultSettings [
serverSocketAddress: (LanguageLinkSocketAddress
ipOrName: 'localhost' port: (9900 + 99 atRandom));
messageBrokerStrategy: LanguageLinkHttpMessageBroker;
serverProcessClass: CarpProcess;
serverProcessClass: CarpPythonProcess;
platform: CarpPlatform new;
commandFactoryClass: CarpCommandFactory;
commandClass: LanguageLinkCommand;