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

[ANNOUNCEMENT] Language Spec & New IDE #515

Open
LingDong- opened this issue Jan 10, 2020 · 3 comments
Open

[ANNOUNCEMENT] Language Spec & New IDE #515

LingDong- opened this issue Jan 10, 2020 · 3 comments
Labels
announcement Announcement from maintainers ide/editor Issue about the online IDE/editor plugins

Comments

@LingDong-
Copy link
Member

Language Spec

Issue #1 is finally resolved! wenyan-lang now has a (relatively complete) specification written in ANTLR (thanks @jiangzoi) 🎉. This also means that parsers in other langauges can potentially be generated automatically (in fact, @jiangzoi is now working on C++ compiler). Check it out here http://wy-lang.org/spec or plain text here ./documentation/wenyan.g4.

The HTML version has clickable anchors and in-page links. Handy for navigation, and links to specific statement/grammar can be posted like so: https://wy-lang.org/spec#assign_statement. Hope you find it useful!

New IDE: /ide2

Our online IDE now has a shiny new look (and a ton of new features). Please check it out here: https://wy-lang.org/ide2. New features include:

  • New layout system with resizable windows - like Sublime, VSCode, etc.
  • CodeMirror replaces in-house janky highlighter and editor. Slicker experience, and no more highlighting problem or input method conflicts (hopefully)!
  • Light and dark themes. (filthy CSS hack, but works)
  • Edit compiled JavaScript. Sometimes I want to tweak the output JS just a bit to quickly test some things before I go back to change the wenyan, now this is possible.
  • Run static typecheck by pressing Compile button. Signature will be shown to output window. Typecheck is skipped when using Run button.
  • Render code as pages from ancient books within the online IDE. Output is currently shown to the output window. To download however, you need to fire up the inspector and copy the source of the SVG's (OK I'll make a download button).
  • Poor man's autocompletion. You can click Insert... and type the initial letters of a keyword's pinyin, and press enter to insert the keyword at the cursor. This is an experimental abuse of the <select> element, and perhaps deserve a better GUI.

Snip20200110_5
Snip20200110_7

Please do check it out and let me know what you think! If it works well we'll replace the old one as the default IDE. I'll also do some dogfooding myself and make improvements. Thanks!

P.S. Currently the code for it (./ide2.html) is a pile of HTML-CSS-JS mixture all dumped in a 500-line soup. Some cleaning up needs to be done before it can be shown to the faint of heart :P

@LingDong- LingDong- added announcement Announcement from maintainers ide/editor Issue about the online IDE/editor plugins labels Jan 10, 2020
@LingDong- LingDong- pinned this issue Jan 10, 2020
@antfu
Copy link
Member

antfu commented Jan 11, 2020

Actually I like how blunt the dark mode hack is! XD

@antfu
Copy link
Member

antfu commented Jan 11, 2020

A few ideas

  • Persistence - save code using localStorage and read it on load
    • We may need something like mandelbrot (Edited) for the examples dropdown
  • I like how url query works in the old ide (Add url query support and history state support to online IDE #386 #400), hope to see it supported by the new one!
    • We can also combine this feature to the Persistence, user can access multiple working codes like ?file=untitled-1
  • Publish to Snippet Site!
    • A publish button for custom code to share with others. This may as need changes to the snippets site to handle code passing by url query.

Just listing the ideas here. I can also try to implement this when I got some time.

@cuixiping
Copy link
Contributor

I think that the IDE should to be another repository.

@antfu antfu mentioned this issue Jan 17, 2020
@LingDong- LingDong- unpinned this issue Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
announcement Announcement from maintainers ide/editor Issue about the online IDE/editor plugins
Projects
None yet
Development

No branches or pull requests

3 participants