Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interpreted languages to SCons #950

Conversation

PeanutbutterWarrior
Copy link
Contributor

Adds most of the interpreted languages to SCons. Their source files are simply copied to the build directory. The languages added are:

  • Bash
  • Julia
  • Lolcode
  • Lua
  • PHP
  • Powershell
  • Python
  • Ruby
  • Smalltalk
  • Viml

Viml might be a typo and supposed to be vim.
I've left matlab out as it currently isn't able to run in the Docker container and I don't know how it runs.
Scratch doesn't seem to have consistent files, as such I have left it out for now. It's common enough (6 uses) that we should work out how we are managing this.
Piet is made up of .png files and are in a directory so won't be noticed by SCons. Only euclidean formula has been written (drawn?) in Piet, so this isn't major.
Whitespace is also in directories and won't be noticed by SCons, but once again is only for euclidean formula.

I haven't checked that interpreters for these are in the Docker image, although I think that most of them are.

@PeanutbutterWarrior
Copy link
Contributor Author

If this is merged it brings us to 15/45 languages building.

@Amaras
Copy link
Member

Amaras commented Nov 29, 2021

Viml (or rather VimL) is the Vim scripting language.

I'll review this more carefully later, but it looks good to me right now.

Copy link
Contributor

@ShadowMitia ShadowMitia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have an issue with renaming the files to the chapter name, as some projects have multiples files. Copying the files and keeping their original names should be sufficient.
We could also have a SConscript for those specific ones, but I feel it's not necessary since it's just copying files about.

@ShadowMitia
Copy link
Contributor

Note: you can just grab the filenames like this:

env.Copier(f'#/build/lang/{file.name}', str(file))

@PeanutbutterWarrior
Copy link
Contributor Author

PeanutbutterWarrior commented Nov 29, 2021

You're probably right, I'll fix that. I also realize that I've missed Javascript and Lisp, so I'll add those too.

@leios
Copy link
Member

leios commented Dec 2, 2021

How does this work with #963? Should we merge one or the other first?

@PeanutbutterWarrior
Copy link
Contributor Author

This one isn't updated yet, and won't work after #963 gets merged. If we can sort out and merge #963 first so I can change this one to fit the new system, and only then merge this one

@PeanutbutterWarrior PeanutbutterWarrior marked this pull request as draft December 2, 2021 16:15
@ShadowMitia
Copy link
Contributor

I might have an issue, it seems we're only copying the files over, right? So that will always succeed even if the code has issues, no?
Or am I missing something? ^^

@PeanutbutterWarrior PeanutbutterWarrior force-pushed the add-interpreted-languages-to-scons branch from 19687b7 to c29525b Compare December 5, 2021 14:52
@PeanutbutterWarrior PeanutbutterWarrior marked this pull request as ready for review December 5, 2021 14:52
@Amaras
Copy link
Member

Amaras commented Dec 5, 2021

If you find a way to compile interpreted files, you are welcome to tell us that way.
The main problem is that we can't detect things like syntax or name errors.

However, it's basically the same thing as for the x86-64 implementation of the forward Euler method that segfaults... We can't do much more than copy files over (well, we could run them, but that's gonna add a lot of complexity and time)

SConstruct Outdated
'python': 'py',
'ruby': 'rb',
'rust': 'rs',
'smalltalk': 'st',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are Smalltalk compilers. Do we really want to require an interpreter?

@ShadowMitia
Copy link
Contributor

Right I think I got mixed up with the code verification stuff. Thanks for the clear-up!

Copy link
Member

@Amaras Amaras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, it's all good for me now!
I'll let you deal with the conflicts in the SConstruct before merging

@Amaras Amaras merged commit b016c59 into algorithm-archivists:main Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants