Coder Social home page Coder Social logo

REPL and incremental compilation about never HOT 4 CLOSED

bogen85 avatar bogen85 commented on August 22, 2024
REPL and incremental compilation

from never.

Comments (4)

bogen85 avatar bogen85 commented on August 22, 2024

https://github.com/never-lang/never/blob/master/back/nev.c#L48 does a module_close ...
And https://github.com/never-lang/never/blob/master/back/nev.c#L91 does a yylex_destroy ...

One of those could be causing some new undesired behavior I'm seeing... (REPL silently exiting after trying a second entry after the first entry was processed correctly...)

from never.

bogen85 avatar bogen85 commented on August 22, 2024

Oh, yylex_destroy calls yy_init_globals, so that is not the issue.

from never.

bogen85 avatar bogen85 commented on August 22, 2024

For now I'm not going to pursue this. Lack of a REPL is no longer a a big deal any more as I can just hit a hot key in a text editor and get instant results of a whole file or selection... (Or do it in a web page)

from never.

bogen85 avatar bogen85 commented on August 22, 2024

Never is a purely functional language.

  1. To have an adequate REPL you need to have globals (well, it is difficult without them), which violates pure functionality.
  2. Additionally from a REPL it is common to need to redefine variable types. Never is a static language, so that makes this difficult.
  3. Some other languages have crude REPL implementations where they keep writing out a main function with the previous entries and new entry combined and compiling and executing it. That is not a true REPL...
  4. For a statically typed language to have a decent REPL that functionally ideally needs to be one of the initial design requirements, not added later.
  5. For a dynamically type language it is not as hard to add later, but Never is not dynamically typed. (If it were I would not be focusing on it).

All that being said, unless a REPL is designed into Never in some future redesign that is alright, but I don't want to suggest something be added to a Never that would violate it's clean design.

A REPL requires some sort of incremental compilation and always being able to use existing compiled code.

from never.

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.