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

Support syntactic macros #210

Open
baronfel opened this issue Oct 20, 2016 · 11 comments

Comments

@baronfel
Copy link
Collaborator

commented Oct 20, 2016

Submitted by Bryan Edds on 3/24/2014 12:00:00 AM
453 votes on UserVoice prior to migration

At least give it a try in a private branch, and upon success, enable them publicly with a compiler switch initially.

Original UserVoice Submission
Archived Uservoice Comments

@dsyme dsyme removed the open label Oct 29, 2016

@dsyme dsyme changed the title Implement Syntactic Macros Support syntactic macros Oct 29, 2016

@gsomix

This comment has been minimized.

Copy link

commented Nov 22, 2016

Bringing typed, modular macros to OCaml

https://oliviernicole.github.io/about_macros.html

@radekm

This comment has been minimized.

Copy link

commented Nov 22, 2016

I don't like the idea of having both type providers and macros in F# since they have a pretty big overlap - especially when https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1023-type-providers-generate-types-from-types.md is implemented.

And currently I prefer type providers over macros since they seem friendlier to IDEs.

@TIHan

This comment has been minimized.

Copy link

commented Nov 22, 2016

Macros add a great amount of complexity to the language. More focus should be on type provider functionality. Let's work with what we've got.

The argument for macros would be better if we had some listings of substantial use cases. Even in the original user voice, there is nothing in there that tells me macros is a must have.

@vasily-kirichenko

This comment has been minimized.

Copy link

commented Nov 26, 2016

Real word usage of that new OCaml macro system https://github.com/OlivierNicole/macros-examples/tree/master/staged-streams

@radekm

This comment has been minimized.

Copy link

commented Nov 26, 2016

@vasily-kirichenko In OCaml there already exist two ways to do that without modular macros:

It would be easier to support compiler plugins (ie. a function which transforms typed AST to another typed AST) in F# compiler than implementing macros in F# language.

@radekm

This comment has been minimized.

Copy link

commented Nov 26, 2016

@vasily-kirichenko Wouldn't be user provided optimizations (optimization plugins) sufficient for implementing strymonas?

@Rickasaurus

This comment has been minimized.

Copy link

commented Nov 30, 2016

I like the idea of compiler plugins. It may be difficult to make it easy to plug into both the actual compiler and the intellisense compiler at the same time though.

@sighoya

This comment has been minimized.

Copy link

commented Oct 14, 2017

+1 for it

@pr-yemibedu

This comment has been minimized.

Copy link

commented May 8, 2018

Hello,
The reason I want syntactic macros is for new syntax over that F# AST.

  • One use case is to allow indexer syntax extension to be improved without waiting years or faulting an underlying BCL implementation.
  • Another would be to allow Reflected Definitions to expose more underlying information so you can write a simple "nameOf" function with quotations.
  • Also a computation expression might now be able to be nested. I am thinking test frameworks with heterogeneous builders that are recursive.

We can have a simple abstraction point with Nim templates that can handle very flat and non-recursive scenarios? It is more powerful than "computation expressions", "operators", "inline" and "quotations" because its purpose is to combine them under a unified context of manipulation.

I mean to be able to create as needed and then to allow to the language authors a chance to bring in with the best implementation of your ideas seems reasonable too. There is a lot of overhead for showing proof for some small language features that could be alleviated this way. Maybe templates should be suggested separate of macros? Thank you. Good day.

@dsyme dsyme added the probably not label Nov 26, 2018

@7sharp9

This comment has been minimized.

Copy link
Member

commented Aug 6, 2019

See myriad for a way of doing this at pre-compile: 7sharp9/myriad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.