moving from classical lex/yacc to pegged parser

2024-05-09 Thread Dmitry Ponyatov via Digitalmars-d-learn
Using lex/yacc I can do a more or less complex things in .yacc semantic actions, such complex as bytecode compilation or real CPU assembly. Playing with `pegged`, I can't figure out how to move from `ParseTree` to such like semantic actions. I even can't parse numbers from strings in lexer-li

Re: D is nice whats really wrong with gc??

2023-12-22 Thread Dmitry Ponyatov via Digitalmars-d-learn
It's called GC phobia, a knee-jerk reaction malady common among C/C++ programmers I'd like to use D in hard realtime apps (gaming can be thought as one of them, but I mostly mean realtime dynamic multimedia and digital signal processing). So, GC in such applications commonly supposed unaccep

[vibe] what's wrong with linking time of vibe applications?

2023-12-22 Thread Dmitry Ponyatov via Digitalmars-d-learn
D lang noted as having a very fast compilation time. Playing with tiny web-interface apps I found that modern versions of dmd & vibe has such a fast compiling but a very long executable linking time. Something like 2-3 seconds of compiling stage (with vibe prebuilt), and 24 seconds of total

pegged: non@safe semantic actions

2023-12-08 Thread Dmitry Ponyatov via Digitalmars-d-learn
What's wrong with using non@safe actions which creates and modifies some external objects? ```D class Layer { int index; string name; this(int index, string name) { class SignalLayer : Layer { class UserLayer : Layer { class PCB { Layer[] layer; PT _deflayer(PT)(PT p) { au

compile-time gremlin/ql across pegged parse trees

2023-12-04 Thread Dmitry Ponyatov via Digitalmars-d-learn
Is anybody tried to implement some query-like adds for Dlang for making data selection from some data structures such as object graphs or trees (at least for pegged parsed data) ? I'm writing tiny tool for KiCAD (EDA CAD), and it would be great to have some tool to write easy-readable declarat

Re: Compiling an app to a single binary - possible?

2023-11-26 Thread Dmitry Ponyatov via Digitalmars-d-learn
Theoretically possible but not really expected to and generally does not give you much over simply distributing an archive. I'd even discourage it because it makes impossible to delegate handling of static assets to reverse proxy like nginx (which is likely to do better job at it being speciali

Re: any chance to get it working on windows xp?

2023-11-25 Thread Dmitry Ponyatov via Digitalmars-d-learn
With no testing on XP, you are bound to run into difficulties trying to use the tools there. The problem looks mostly not in WinXP-hosted compiler and tools, but in core and side libraries support such as `druntime`, `phobos`, etc. As a sample, I can use LDC for cross-compiling from Linux for

Re: Symbolic computations in D

2023-11-25 Thread Dmitry Ponyatov via Digitalmars-d-learn
What are semantic limitations you talking about? lack of pattern matching as example, which can tend to lots of ugly code

Re: What parser generator can let me run arbitrary code in its match rules?

2023-11-20 Thread Dmitry Ponyatov via Digitalmars-d-learn
Or maybe someone advice me some set of books deeply targets for learning of binary and symmetric parsing (such as binpac), DCG in C or using generators in D, etc to let me write my own lib. Everething I found (besides the Dragon book) uses black magic with Haskell, Lisp etc.

What parser generator can let me run arbitrary code in its match rules?

2023-11-20 Thread Dmitry Ponyatov via Digitalmars-d-learn
- not abandoned years ago - documentation and commented samples presenets - CTFE the best

Symbolic computations in D

2023-10-29 Thread Dmitry Ponyatov via Digitalmars-d-learn
Yesterday some student asked me about ability to make some dumb symbolic computation in C++ the same like way as it looks in the MathCAD or Maxima CAS, but run it compiled on a robot platform in realtime. I have no idea about CAS design and internals, or any math at all, but today I found som

Re: druntime homebrew: setup and compile a single project with its own stdlib

2023-10-29 Thread Dmitry Ponyatov via Digitalmars-d-learn
If you have a module source file with the same name you want to replace, the build will prioritize your own version. You mean I can create `project/druntime`, and replace the core D runtime part by part by placing here my own files from druntime source? And compiler will route his internal c

Re: Search for the dialog library

2023-10-15 Thread Dmitry Ponyatov via Digitalmars-d-learn
On Saturday, 14 October 2023 at 23:02:34 UTC, Alexander Zhirov wrote: Colleagues, tell me, please, is there any library on D for drawing dialog boxes? Maybe it's time to port the old warm tubby Turbo Vision into the glorious D lang? https://github.com/magiblot/tvision

use dmd for bare metal i386

2023-10-13 Thread Dmitry Ponyatov via Digitalmars-d-learn
Is dmd able to be forced not include some unneeded information into target object files to make bare metal 32-bit code? Need some samples and build scripts to do it. Or maybe move to ldc2 required