Spivoxity / obc-3

Oxford Oberon-2 compiler
38 stars 7 forks source link

Debugger and browser cannot deal with .mod extension #39

Closed rsdoiel closed 3 years ago

rsdoiel commented 3 years ago

Hello Mike,

We haven't met but thank you for a nice Oberon compiler. I've implemented support for file extensions of ".Mod" and ".obn" in my local version of your compiler. My motivation is I am documenting some work I am doing with Oberon-7 on POSIX systems and would like the opportunity to include instructions for your compiler but avoid renaming allot of files.

The files I wound up modifying we compiler/main.ml and scripts/obc-in. Should I submit a pull request or send diffs?

On the other hand you use your compiler in instruction and I can certainly understand wanting students to standardize around a small set of file extensions if only to keep the support overhead manageable.

All the best,

Robert Doiel

Spivoxity commented 3 years ago

Thank you for the suggestion. Some notes in case I decide to implement it:

Thanks also for the offer of a patch, but I don't think having one would save much of the time needed to implement a proper solution.

Best wishes,

-- Mike

Spivoxity commented 3 years ago

I've changed the title to reflect the defect in the current handling of source file extensions. I will push a proposed fix to the main branch in a moment. It has had only very superficial testing, and none at all on Windows.

rsdoiel commented 3 years ago

Thank you for concidering the change. I am sorry my familiarity with ML is rather limited to reading a book on Standard ML years ago. Your notes are clear, now I'm tempted to learn ML. Also sorry I forget about Windows, been a long time sence I used it.

Thank you for creating obc as I mentioned before. I like how you handled the module list in the shell script. As I learn my way around Oberon it has been very helpful to have your and Karl's compilers available for comparison in the POSIX setting

All the best,

Robert

On Thu, Oct 1, 2020, 4:50 PM Mike Spivey notifications@github.com wrote:

Thank you for the suggestion. Some notes in case I decide to implement it:

  • A proper solution would have to work on Windows too, so would require modification of the Windows wrapper program obc.exe also.
  • It would be preferable if main.ml either was independent of the extension of the source file, or worked with a list of possible extensions, rather than a chain of tests.
  • The main program of the Oberon browser obb in browser.ml needs to find the source file from the .k file in order to display doc comments: at present this works if the source file has extension .m, but not if the extension is .mod. That needs fixing, preferably so that the list of allowable extensions is shared with the list used in main.ml.
  • Perhaps it would be best to record the name of the source file (relative or absolute) in the .k file complete with extension so that the browser can find it, and not have the risk of finding an existing file with a different extension from the compiler input.

Thanks also for the offer of a patch, but I don't think having one would save much of the time needed to implement a proper solution.

Best wishes,

-- Mike

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Spivoxity/obc-3/issues/39#issuecomment-702454126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJIPIL3VFBXJUEDEK6THLSIUITVANCNFSM4SA6V52Q .