theletterf / english-lang

The English Programming Language
https://en.wikipedia.org/wiki/English_language
465 stars 11 forks source link

Ambiguous expressions #6

Open snarfed opened 1 year ago

snarfed commented 1 year ago

I'm having trouble with English's non-determinism: I keep hitting expressions that have multiple valid interpretations, and the runtime doesn't always return the same result. It happens infrequently, but consistently.

For example, "Time flies like an arrow" has at least three valid interpretations, each with a different result.

When the runtime hits one of these, it seems to run some kind of ML model to predict the best interpretation based on the program's current state. This works surprisingly well, but the non-determinism is worrying, as is the unexpected complexity and cost.

How much of a breaking change would it be to either mandate a fixed interpretation for all of these ambiguities, or just remove them altogether?

Thanks in advance. I'm loving English otherwise, it's impressively powerful and concise. And so widely supported!

srbhr commented 1 year ago

Yes, there are certain cases where expressions have multiple valid interpretations. Also, there are cases where re-arrangement changes the meaning. It depends on which compiler we are using at the time. Since there are over 150+ forks (each has its own compiler JIT, even AOT in certain cases). So, "Time flies like an arrow", but isn't time relative?

mtekman commented 1 year ago

There was a recent PR to embed intonation into the language so that context could be inferred from tonality, but it was sadly rejected as WONTFIX by the ENG23 committee who instead passed the buck onto the downstream compilers.

srbhr commented 1 year ago

Yes, as local compilers are context aware in terms of tonality and space. As "Time flies like an arrow" during an exam, vs "Time flies like an arrow" while visiting someone are different. (Spatial awareness).

So, english-lang and infer meaning, time, space, tonality and works in isolated environments. It's a real high level language 😂

yunruse commented 1 year ago

WONTFIX isn't the smartest move. Depending on your interpretation this is actually a collection of bugs.

The recent proposal for the -> operator could help? It will surely sate the time flies' hunger and lend us the power to retroactively correct this ambiguity once and for all

mtekman commented 1 year ago

It might, but in the long term I see the -> operator only doing more harm than good and could be weaponized for malicious purposes. Remember the 8-EQUALS-D fiasco?

yunruse commented 1 year ago

I do (it was a hard fork, if I remember). But flies love their syntactic sugar…

srbhr commented 1 year ago

Yeah, I think we should leave ambiguous sentences to local compilers themselves. Unless we're using the "strict" operator. In that case, we need to specify interpretation with a .context file.

theletterf commented 1 year ago

I think Basic English could be a solution to this. It's a small subset of English for embedded devices and low performance platforms: https://en.wikipedia.org/wiki/Basic_English