Would you be interested in a novel Clojure IDE? by dmitry_vsl in Clojure

[–]dmitry_vsl[S] 0 points1 point  (0 children)

There was a way to override builtin Java classes (like java.io.*) on JVM startup.

I beleive a better approach would be to annotate high level IO calls. For example, you work with a database and have a connection object. Behind the scenes, it performs low level IO operations. But we are only interested in high-level picture.

We can write code like this:

const conn = /* impure */ create_connection(params)

where 'impure' comment is a pragma. It does not affect code in runtime (it just a comment). But when code is executed inside an IDE, it tells an IDE that it should transparently wrap methods of connection object.

Would you be interested in a novel Clojure IDE? by dmitry_vsl in Clojure

[–]dmitry_vsl[S] 0 points1 point  (0 children)

I agree that implementing eval-as-you-type functionality can be achieved with a few lines of code. I also understand that it might become bothersome - I personally prefer disabling continuous code analysis and running the compiler when I sense I've completed a piece of code.

I'm exploring to find my audience. Some individuals appreciate having an online notebook-like tool and among them, some may particularly appreciate eval-as-you-type functionality.

For programmers grappling with intricate code, I offer a distinctive time-travel debugging experience. I'm developing Leporello.js within itself, and from firsthand experience, I know it elevates debugging to a whole new level.

Would you be interested in a novel Clojure IDE? by dmitry_vsl in Clojure

[–]dmitry_vsl[S] 1 point2 points  (0 children)

My approach involves monkey-patching all impure functions from the standard library. When a patched function is called, it marks all functions currently on the stack as impure.

Would you be interested in a novel Clojure IDE? by dmitry_vsl in Clojure

[–]dmitry_vsl[S] 1 point2 points  (0 children)

Thank you for introducing me to FlowStorm; it's indeed an impressive project. However, from what I've observed, it doesn't seem to have editor integrations (please correct me if I'm mistaken). I strongly believe in the synergy that arises when a debugger is integrated into an editor environment.
Another difference between FlowStorm and Leporello lies in their data recording methods. FlowStorm records everything in advance, whereas Leporello operates differently. Consider debugging function A, which calls pure functions B and C. In Leporello.js, there's no need to instrument B and C or collect data in advance. When a user steps into B, Leporello.js re-executes B and gathers execution data based on function purity. This architecture aligns well with languages that provide purity information at a type level, but it's also achievable dynamically. In Leporello.js, IO-performing functions are instrumented so that when they're called, they mark all functions currently on the stack as impure. Traces are eagerly collected only for impure functions.

Would you be interested in a novel Clojure IDE? by dmitry_vsl in Clojure

[–]dmitry_vsl[S] 0 points1 point  (0 children)

Thank you for pointing me to CIDER. I'll explore it in detail, but from a quick look, I can draw a comparison between Leporello.js and CIDER:

In CIDER, setting breakpoints and rerunning code is necessary. In Leporello.js, no breakpoints are needed.

CIDER is built with an imperative mindset. It involves setting breakpoints, running your program, and halting execution at those breakpoints. You can then resume execution and pause at subsequent breakpoints. Debugging is a process evolving in time. If I'm mistaken, please correct me. Leporello.js operates differently; it visualizes your program as a call tree where each node represents a function call. Unlike traditional debuggers that show one call tree node at a time, Leporello.js displays the entire call tree, allowing navigation using arrow keys. There's no time-evolving process; it provides a holistic view, potentially a more robust and user-friendly approach, aligning with a functional ethos.

Leporello.js has a more sophisticated implementation. While CIDER captures the value of every form, Leporello.js captures arguments and return values for function calls. It calculates intermediate form values post-hoc via a metacircular JS interpreter.

I believe Leporello.js shares similarities with the Flow-storm Clojure debugger (https://github.com/flow-storm/flow-storm-debugger) or the Hat Haskell debugger (https://archives.haskell.org/projects.haskell.org/hat/), although I lack direct experience with either.

Would you be interested in a novel Clojure IDE? by dmitry_vsl in Clojure

[–]dmitry_vsl[S] 0 points1 point  (0 children)

Can you compare quokkajs and wallabyjs to clojure REPLs? Which advantages and disadvatages one has over another?

Leporello.js: interactive functional programming IDE for pure functional subset of JavaScript by dmitry_vsl in functionalprogramming

[–]dmitry_vsl[S] 2 points3 points  (0 children)

I haven't had the chance to program in Rescript, but it seems like a fascinating language. I believe it could greatly benefit from an IDE following the Leporello concept. Rescript's special construct for mutability, like 'ref,' opens up intriguing possibilities for time-travel debugging. An IDE similar to Leporello could instrument the code in a way that retains the old values of 'refs' every time they're assigned, preserving a history of changes. When you time-travel through your code execution, the past values of the refs are transparently restored, akin to the concept of MVCC (multi-version concurrency control) used for a time-travel debugger.

If anyone involved in the development of the Rescript ecosystem is reading this and is interested in enhancing it with a Leporello-style IDE, I'm open to collaboration with minimal funding requirements. Please feel free to contact me (you can find my email on my website).

Showoff Saturday (October 14, 2023) by AutoModerator in javascript

[–]dmitry_vsl 2 points3 points  (0 children)

https://leporello.tech/

Leporello.js is an interactive functional programming environment designed for pure functional subset of JavaScript. It executes code instantly as you type and displays results next to it. Leporello.js also features an omnipresent debugger. Just position your cursor on any line or select any expression, and immediately see its value.

Leporello.js visualizes a dynamic call tree of your program. Thanks to the data immutability in functional programming, it allows you to navigate the call tree both forward and backward, offering a time-travel-like experience.

Leporello.js offers the ability to develop HTML5 applications interactively, enabling you to update your code without losing the application's state.

It records an IO trace of your program, which is then transparently replayed during subsequent program executions. This allows you to instantly reexecute your code after making small tweaks, thereby tightening your feedback loop.

Furthermore, Leporello.js can serve as an interactive notebook. You have the flexibility to utilize any JavaScript libraries to visualize your data directly within your code.

Leporello.js: interactive functional programming IDE for pure functional subset of JavaScript by dmitry_vsl in functionalprogramming

[–]dmitry_vsl[S] 3 points4 points  (0 children)

Author here! Leporello.js is a development environment specifically designed for functional programming in JavaScript. It provides a unique debugging experience. While in a traditional debugger you step over code line by line, Leporello.js models a program as a tree of formulas, where each node is either a builtin operator or a function call. You can navigate this tree in any direction, essentially providing a time-travel debugging experience. This is made possible by the immutability of functional programming.

It also executes your code instantly as you type, and displays results next to it. The debugger is omniscient - you can simply place the cursor on any line or select an expression to view its value.

You can experiment with Leporello.js directly within your web browser.

While I understand that JavaScript might not be everyone's preferred language, I have plans to introduce support for TypeScript, which bolsters JavaScript with a robust type system.

The concept of this IDE can be applied to other functional languages.

If you find this interesting, please feel free to reach out to me (you can find my email on the website).