-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Issue executing Elsa via. Cask #179
Comments
Yea, the The problem is that I don't know how to get the declare forms work without having Elsa installed and loaded. Which is one of my hard requirements, to be able to analyze/annotate code which does not assume Elsa exists (like 3rd party packages where we can't convince the maintainer to adopt and support it). tldr syntax is: ;; (add-one :: (function (int) int))
(defun add-one (x)
(1+ x)) This is not 100% final and if we come up with nicer syntax it might be changed in the future. You can browse the code and see the annotations used in Elsa itself. |
But the weird part is that you didn't get an error about the unknown |
Ah okay, that explains that then! Works fine with the comment syntax now :)
Is this about the
This would also work for defvars which could be nice. |
The reason why I wanted to use Yesterday I got an idea that maybe we could push it into the docstring, either as a one liner or as some extended syntax. The first version would provide useful if we wanted to auto-generate api reference, as it is very easily machine processable.
|
Including the annotations in the docstrings is interesting, could provide some value to folks who are using dependencies that use elsa but aren't using it themselves. If elsa ends up going with types that are inside of comments/strings, it might be best to reduce parentheses as much as possible -- lispy turns off it's features inside of strings/comments which makes working with sexps not very fun (i assume this is true for paredit/smartparens as well?) One approach I think is worth reconsidering is annotation macros:
This wouldn't require elsa as a dependency for those using byte-compiled packages but would be required as a dev dependency. In exchange it would afford much more flexibility to Elsa -- for example, attempting to cast a value would likely be very cumbersome just using comments (re: #180). Maybe an acceptable tradeoff? |
Yea, this is something that crossed my mind but I didn't spend much time on how to implementit. I didn't consider compile type macros, that might work fine. Smartparens works with sexps inside comments by default but it can be configured not to. However, I agree that the parens can become a problem, especially when nesting composite types, such as functions, unions and constants all together, it's very clumsy. The original haskell-inspired notation solved this nicely but wasn't a great fit for the community. So we'll have to come up with something lisp-like but not overwhelming at the same time. |
I saw this repo is getting some new commits (which is awesome!) so wanted to test out the new syntax, however I was unable to get it working properly. I may be missing something basic, but here's my steps to repro:
cask install
cask exec elsa <file>
The text was updated successfully, but these errors were encountered: