Thread overview
repls for d
Oct 31
monkyyy
Oct 31
monkyyy
Nov 01
monkyyy
Nov 01
jmh530
Nov 04
jmh530
Nov 04
monkyyy
October 31

So I like repl programming, Im aware of dlang.io and the project on dub; I ussally use dlang.io despite the blind theme, it often being out of date, and slow. But today I needed it to be in the terminal, so I made an another terrible solution

https://gist.github.com/crazymonkyyy/bd90fe3e7a9372cbe5c644cce11c1b9e

Its an ed like line editer... so terrible, truely awful. Maybe someone else cares tho.

Are there other solutions or some travail improvement?

October 31

On Thursday, 31 October 2024 at 21:48:24 UTC, monkyyy wrote:

>

So I like repl programming, Im aware of dlang.io and the project on dub; I ussally use dlang.io despite the blind theme, it often being out of date, and slow. But today I needed it to be in the terminal, so I made an another terrible solution

https://gist.github.com/crazymonkyyy/bd90fe3e7a9372cbe5c644cce11c1b9e

Its an ed like line editer... so terrible, truely awful. Maybe someone else cares tho.

Are there other solutions or some travail improvement?

yeah you can build shared libraries and use them to load new versions of the code dynamically.
There is a drepl project which used this IIRC.
However maybe it won't compile anymore?

October 31

On Thursday, 31 October 2024 at 22:16:03 UTC, Stefan Koch wrote:

>

On Thursday, 31 October 2024 at 21:48:24 UTC, monkyyy wrote:

>

So I like repl programming, Im aware of dlang.io and the project on dub; I ussally use dlang.io despite the blind theme, it often being out of date, and slow. But today I needed it to be in the terminal, so I made an another terrible solution

https://gist.github.com/crazymonkyyy/bd90fe3e7a9372cbe5c644cce11c1b9e

Its an ed like line editer... so terrible, truely awful. Maybe someone else cares tho.

Are there other solutions or some travail improvement?

yeah you can build shared libraries and use them to load new versions of the code dynamically.
There is a drepl project which used this IIRC.
However maybe it won't compile anymore?

adr also suggested dll hacks, and I still dont understand it
d compiler is fast enough that you can just copy a 100 lines in and out of memory and have it compile effectly instantly; if it didnt Id be blaming the std before the code the copyed such a comparably small string

November 01

On Thursday, 31 October 2024 at 23:41:47 UTC, monkyyy wrote:

>

adr also suggested dll hacks, and I still dont understand it
d compiler is fast enough that you can just copy a 100 lines in and out of memory and have it compile effectly instantly; if it didnt Id be blaming the std before the code the copyed such a comparably small string

This is the drepl project: https://github.com/dlang-community/drepl

The way I've always written my programs is to make a few changes, recompile with DMD, and fix anything that needs fixing. This works just fine even for projects with tens of thousands of lines of code as long as you avoid anything but the simplest templates.

November 01

On Friday, 1 November 2024 at 01:03:44 UTC, Lance Bachmeier wrote:

>

This is the drepl project: https://github.com/dlang-community/drepl

I dont think its been compiling for a while, and I didnt care much when it was

November 01

On Friday, 1 November 2024 at 01:52:54 UTC, monkyyy wrote:

>

On Friday, 1 November 2024 at 01:03:44 UTC, Lance Bachmeier wrote:

>

This is the drepl project: https://github.com/dlang-community/drepl

I dont think its been compiling for a while, and I didnt care much when it was

I had some issues with the linenoise dependency preBuildCommands script, around a year ago.

The fix was to use the $LINENOISE_PACKAGE_DIR variable instead of $PACKAGE_DIR to build drepl.

from:

"cd $PACKAGE_DIR; [ -f C/linenoise.o ] || cc -c -fPIC -o C/linenoise.o C/linenoise.c" platform="posix"

to:

"cd $LINENOISE_PACKAGE_DIR; [ -f C/linenoise.o ] || cc -c -fPIC -o C/linenoise.o C/linenoise.c" platform="posix"

I changed it directly in the ~/.dub/packages/linenoise/1.1.0+1.0.0/linenoise/dub.json.

The parsing being done by an older libdparse library, short function forms like int addOne(int i) => i + 1; or named function argument are not available.

November 01

On Friday, 1 November 2024 at 22:48:25 UTC, Rémy Mouëza wrote:

>

On Friday, 1 November 2024 at 01:52:54 UTC, monkyyy wrote:

>

[...]

I had some issues with the linenoise dependency preBuildCommands script, around a year ago.

The fix was to use the $LINENOISE_PACKAGE_DIR variable instead of $PACKAGE_DIR to build drepl.

from:

"cd $PACKAGE_DIR; [ -f C/linenoise.o ] || cc -c -fPIC -o C/linenoise.o C/linenoise.c" platform="posix"

to:

"cd $LINENOISE_PACKAGE_DIR; [ -f C/linenoise.o ] || cc -c -fPIC -o C/linenoise.o C/linenoise.c" platform="posix"

I changed it directly in the ~/.dub/packages/linenoise/1.1.0+1.0.0/linenoise/dub.json.

The parsing being done by an older libdparse library, short function forms like int addOne(int i) => i + 1; or named function argument are not available.

Would you be able to submit the fix?

November 04

On Friday, 1 November 2024 at 23:48:10 UTC, jmh530 wrote:

>

Would you be able to submit the fix?

Someone already did it. It's not been merged yet:
https://github.com/MartinNowak/linenoise/pull/1/files

November 04

On Monday, 4 November 2024 at 19:27:34 UTC, Rémy Mouëza wrote:

>

On Friday, 1 November 2024 at 23:48:10 UTC, jmh530 wrote:

>

Would you be able to submit the fix?

Someone already did it. It's not been merged yet:
https://github.com/MartinNowak/linenoise/pull/1/files

Thanks. Only over a year old...

November 04

On Monday, 4 November 2024 at 19:46:59 UTC, jmh530 wrote:

>

On Monday, 4 November 2024 at 19:27:34 UTC, Rémy Mouëza wrote:

>

On Friday, 1 November 2024 at 23:48:10 UTC, jmh530 wrote:

>

Would you be able to submit the fix?

Someone already did it. It's not been merged yet:
https://github.com/MartinNowak/linenoise/pull/1/files

Thanks. Only over a year old...

I dont remeber why I dont care about drepl much, but isnt it overcomplex for what you need?

Repl-ish tools shouldnt need to parse d, just that the text editor to compiler maybe more then 1 key press before giving you results, the compiler for sub lets say 500 lines files should be a key press compile time.