#plain-english output mode for phobos?
1 messages · Page 1 of 1 (latest)
mostly you'd pick some reasonably clear phrases for everything
I'd appreciate JS-like output :p
i guess to do it well you'd ahve to be api aware so you can change yoru phrasing for things like on_event
TS output is planned :P
JS, uh, idk? TS is better anyway afaik
but like, local funciton foo() ... end -> there is a local function foo which takes no arguments. Its body does....
hmmmm alright that's an interesting idea
it might be less ridiculous than it sounds at first depending on how modular you can make english sentences
it's an insane idea, but it woudl be very cool
but if you start with just describing syntax and then maybe plug in some api awareness later as needed
you coudl probably get something at least usable on simple examples
as long as it's parseable without ambiguity
api awareness would probably be much easier with a type resolver/system already in place... but i'm curious in trying something simple first. just to see how hard it would really be
yeah it may be that just having types available for explanations may be enough actually 🤔
if you mean english ambiguity you might could avoid some of taht by doing interleaved lines or such to ensure the explanation is close to the corresponding code
in much the same way we do for disassembly
and just by choosing words and phrasing carefully
i'm imagining some of the crazy type descriptions for what the type system should/will be able to do. like
"at this point foo is either a number that is less than 10 or if bar is a string it is less than 20"
idk if it'll actually be that crazy, but it might
something that's hard in english is conveying when a block ends. Something i actually have trouble with when using english in general because my brain is wired like a programming language at this point 😂
but to better explain what i mean
if foo > 100 then
print("hello world")
bar(foo)
end
how to say that at end the if block ends without repeating the whole condition. just saying "end of if block" would be too program language like
stupid answer: just indent a section?
might be less stupid than you think :D
if foo is greater than 100, then:
print "hello world"
call bar with argument foo
i would still count that as "plain english mode" 🤷
you could even add bullet points if you want (or numbers?)
but i too am
ðŸ§
yea that's actually not that bad. reminds me of python, a part about it that i don't like, but oh well. as long as it's readable as english i suppose you're right
maybe loop {} would be nice
you mean using {} to indicate blocks? that's not english though, that's a programming language