Coder Social home page Coder Social logo

Perhaps extensible syntax? about eo HOT 6 CLOSED

objectionary avatar objectionary commented on August 21, 2024
Perhaps extensible syntax?

from eo.

Comments (6)

yegor256 avatar yegor256 commented on August 21, 2024 10

@adrian-herscu I'm personally strongly against that kind of DSL's. I believe that they only make code less readable. I'm using Ruby a lot and I really hate their DSL's. Very often I simply can't understand what the code does and have no idea where to look for documentation. So, I'm in favor of a very strict and specific syntax. No sugar, no DSLs, etc. See aa56f21

from eo.

ljleb avatar ljleb commented on August 21, 2024 5

@yegor256 I believe there should be space for DSLs in a general programming language. Otherwise, boilerplate code will probably be necessary for some particular tasks.

In an attempt to support my point of view, I want to point out that the README already contains some code that could be considered as beloning to a DSL. Namely, the printf function takes a string in which % is considered special character. If the argument to printf is not a DSL, I don't know what is :)

from eo.

flammar avatar flammar commented on August 21, 2024 2

As I understand, every such custom DSL uses the idea of using compile-time analysis, mainly in IDE, to verify a statement in this DSL. Also, a question about DSL is not always a question about syntax extensibility, e.g. Scala-based DSLs.

from eo.

ArneBachmann avatar ArneBachmann commented on August 21, 2024

Agree. Languages with too much "magic" give me the creeps (e.g. Elixir, Ruby frameworks)

from eo.

kerelape avatar kerelape commented on August 21, 2024

@yegor256 I believe there should be space for DSLs in a general programming language. Otherwise, boilerplate code will probably be necessary for some particular tasks.

In an attempt to support my point of view, I want to point out that the README already contains some code that could be considered as beloning to a DSL. Namely, the printf function takes a string in which % is considered special character. If the argument to printf is not a DSL, I don't know what is :)

printf's % is not a language feature. You can always make your own parser for that using EO and no DSL in context of the language would appear

from eo.

ljleb avatar ljleb commented on August 21, 2024

printf's % is not a language feature. You can always make your own parser for that using EO and no DSL in context of the language would appear

You're reviving a very old thread!

In any case, I believe what I meant is that printf's argument has its own domain specific syntax. Even though you put quotes around the argument, it still has to follow a domain specific syntax and isn't free form. AFAIK, part the definition of a DSL is that it has to have a grammar, no matter whether the parsing occurs at runtime or compile time.

I agree with you that it isn't a language feature, but a DSL doesn't have to be a language feature, all it needs to do is be its own language IIUC.

It appears I wanted to use this point to support the view that DSLs can help simplify code, which I still believe is sound. For example, printf %, regexes or numpy's einsum mini-language (which, IIUC, are all domain specific languages) can consolidate code and make it easier to read.

from eo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.