Category talk:Plain English: Difference between revisions

→‎EBNF: Thanks
(→‎EBNF: Thanks)
 
(19 intermediate revisions by 5 users not shown)
Line 17:
 
::: Edit "the finder" line 395 from "item" or "items" to "iteM" or "iteMs" and repeat (R/Run in cal-3040-orig.exe). You should now have a cal-3040.exe which shows that capital M top right, which does not go away if you undo those edits (until another R/Run). --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 19:26, 20 September 2020 (UTC)
 
:::: Very well. Now the question is, how to compile and run any other program than the compiler itself? --[[User:Dick de Bill|Dick de Bill]] ([[User talk:Dick de Bill|talk]]) 20:22, 20 September 2020 (UTC)
 
:: Then I looked for another version of the compiler, thinking maybe <code>cal-3040.exe</code> is just buggy, and I found <code>cal-4700.exe</code>. The name suggests it is a newer, better version. Indeed, this one has a new feature – it only makes a copy of itself when ran on its own source. When compiling <code>source.txt</code>, it showed an error message <code>I need a routine to 'initialize before run'.</code> and besides that produced no output. Then I tested a few task implementations from RC. I picked those which were supposed to produce output, and thus prove that the program – and hence the compiler – works correctly. These tasks all contain a definition <code>To run:</code>, and they all ended up in an error message <code>Error in the desktop. I already know how to 'run'.</code> without producing any other output.
Line 27 ⟶ 29:
 
:Ah, the clue train shows signs of slowing down to a stop for me. It seems that I had only come across the PE examples at RC where the task description did not require output. I eventually spotted one with output, and noted that the PE source was indeed substantial enough to accomplish the task. I apologize for the disparaging remarks I made about PE. I stand corrected, not clutter. --[[User:Enter your username|Enter your username]] ([[User talk:Enter your username|talk]]) 17:25, 16 September 2020 (UTC)
 
==cannot run any examples==
Clearly we all need some extra help here. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 01:53, 21 September 2020 (UTC)
: All of the examples I have submitted to Rosetta Code compile and run with cal-4700.exe. Here are some sticking points that folks may be running into:
:* It only works in Windows.
:* The compiler only compiles source code with extensionless filenames. ¯\_(ツ)_/¯
:* A copy of the noodle must be present in the same directory as your extensionless source filename. Yes, this means you need to copy it from the main directory to your project directory. Unsophisticated, but such is life. The noodle is a simply another source file that acts as a standard library of sorts.
 
:Here is an example of my workflow.
 
:* Open cal-4700.exe. I have it in C:\Users\Chunes\Code\Plain English\.
:* Using the arrow and enter keys, navigate to C:\Users\Chunes\Code\Plain English\.
:* Use the arrow keys to highlight "the noodle" and press ctrl-c to copy the file to the clipboard.
:* Using the arrow and enter keys, navigate to C:\Users\Chunes\Code\Plain English\Work\Rosetta Code\ which is where my Plain English RC projects live.
:* Press the "N" button with the mouse and create a new directory. Name it "arithmetic-mean" for example.
:* Navigate to the new folder.
:* Press ctrl-v to paste the noodle into this folder.
:* Press the "N" button with the mouse and create a new file (for the source code). Name it "arithmetic mean". (No extensions, remember.)
:* Navigate to the newly created source file and press enter to open it for editing.
:* Now type/copy the source code into this file.
:* Press ctrl-r to compile and run the program. This will also drop the executable file in the same directory as your source code. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 10:04, 21 September 2020 (UTC)
 
::Excellent, thanks. I've just made [[User_input/Text#Plain_English]] runnable. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 11:34, 21 September 2020 (UTC)
 
::: Regarding that particular task, I think it would be quite helpful if the Plain English implementation demonstrated how to save the user input into variables, like other implementations do. --[[User:Dick de Bill|Dick de Bill]] ([[User talk:Dick de Bill|talk]])
 
:::: Oh, but is has. Any time you see <code>a/an/some whatever</code> inside a routine body in Plain English, that is introducing a new variable into the routine's scope. To refer to <code>a string</code> and <code>a number</code> you would say <code>the string</code> and <code>the number</code>. (When you see <code>a/an/some whatever</code> in a routine header, that is a parameter.) --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 09:23, 22 September 2020 (UTC)
 
::::: However, I see how it can be confusing, so I have updated the task to show how to refer to the values read from the console. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 09:43, 22 September 2020 (UTC)
 
:: The above workflow should be in [[Hello_world/Newbie]]! (but of course "beautified") Hmm... I guess I'll try to write the initial write-up. --[[User:Simple9371|Simple9371]] ([[User talk:Simple9371|talk]]) 08:25, 28 November 2020 (UTC)
 
::: Thanks for volunteering to work on that. Here's a little improvement to the flow that I have since learned. The IDE is kind enough to copy the noodle to the current directory when you press ctrl+v in the file navigator (while maintaining the existing contents of your clipboard elsewhere). So all you have to do is press ctrl+v wherever your source file is to put a copy of the noodle there. --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 09:48, 28 November 2020 (UTC)
 
== EBNF ==
 
Does anyone know of a program that will read [http://www.osmosian.com/ebnf this file] and generate a graphic version of the Plain English language's EBNF?
<br />--[[User:GarveyPatrickD|GarveyPatrickD]] ([[User talk:GarveyPatrickD|talk]]) 22:15, 10 June 2021 (UTC)
 
: You mean something like [https://i.stack.imgur.com/WpQXF.gif this]? Making such diagrams from EBNF sounds like an interesting new task for RC :) --[[User:Dick de Bill|Dick de Bill]] ([[User talk:Dick de Bill|talk]]) 02:56, 5 March 2022 (UTC)
 
:: Yes, that is the type of diagram I am looking for. Do you have any suggestions other than writing a task description? --[[User:GarveyPatrickD|GarveyPatrickD]] ([[User talk:GarveyPatrickD|talk]]) 03:56, 5 March 2022 (UTC)
 
::: None besides using your favorite search engine (if you haven't already). I have no idea if such a thing exists but I imagine hacking something together using some graph library shouldn't be difficult (make a graph, export to `.dot` file and convert to PDF). --[[User:Dick de Bill|Dick de Bill]] ([[User talk:Dick de Bill|talk]]) 08:27, 5 March 2022 (UTC)
 
:::: Thank you. --[[User:GarveyPatrickD|GarveyPatrickD]] ([[User talk:GarveyPatrickD|talk]]) 18:34, 5 March 2022 (UTC)
1,606

edits