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

Added HDL (Hardware Description Language) support #1710

Merged
merged 6 commits into from
Jan 15, 2019
Merged

Added HDL (Hardware Description Language) support #1710

merged 6 commits into from
Jan 15, 2019

Conversation

stephanmax
Copy link
Contributor

I added support for the declarative Hardware Description Language used in the Coursera Nand2Tetris (https://phoenix.goucher.edu/~kelliher/f2015/cs220/hdlSurvivalGuide.pdf).

Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Thank you for contributing!

But there are a few things we will have to change before we can merge this.

  1. Please choose a better name. There is no one HDL language.
  2. Please correct the indentation of your tests.

components/prism-hdl.js Outdated Show resolved Hide resolved
components/prism-hdl.js Outdated Show resolved Hide resolved
tests/languages/hdl/boolean_feature.test Outdated Show resolved Hide resolved
@stephanmax
Copy link
Contributor Author

Thanks for your feedback, @RunDevelopment. I applied all changes as requested. PS. Say Hi to my hometown Leipzig 😃

@RunDevelopment
Copy link
Member

RunDevelopment commented Jan 15, 2019

Nice work.

Wouldn't it be possible to use the C-like function here? I don't know if stuff like Not, And, and so on are called functions here but they do look like it.
And could you please also add an example page?

Also, is there a spec for this language?

@stephanmax
Copy link
Contributor Author

The semantics behind And and Not is actually a bit different than the notion of functions. They have to be HDL scripts in the same folder with the same name. Actually, they could be called Bananarama as long as there is a Bananarama.hdl file next to it.

There is only an informal spec in the appendix of the course‘s accompanying book.

@RunDevelopment
Copy link
Member

There is only an informal spec in the appendix of the course‘s accompanying book.

Well, can't do anything about that.

The semantics behind And and Not is actually a bit different than the notion of functions. They have to be HDL scripts in the same folder with the same name. Actually, they could be called Bananarama as long as there is a Bananarama.hdl file next to it.

So the function name has to relate to a file name (excluding builtins like And I suppose).
I think this pretty much falls within the concept of a function so can we land this feature?

@stephanmax
Copy link
Contributor Author

So the function name has to relate to a file name (excluding builtins like And I suppose).
I think this pretty much falls within the concept of a function so can we land this feature?

You got me convinced! Yes, it is actually like a function 👍

components.json Outdated Show resolved Hide resolved
@RunDevelopment RunDevelopment merged commit b94b56c into PrismJS:master Jan 15, 2019
@RunDevelopment
Copy link
Member

Thank you for contributing!

@stephanmax stephanmax deleted the language/hdl branch January 15, 2019 14:56
@ghost
Copy link

ghost commented Jan 17, 2019

It seems to me that components/prism-hdl.min.js shouldn’t have been committed.

@RunDevelopment
Copy link
Member

Indeed! I'll fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants