lainchan / λ

/λ/.ru

Moore · 2022-10-01 02:10
знаете ли вы о творчестве Валентин Фёдорович Турчин? вы программировали в РЕФАЛ?(USER WAS WARNED FOR THIS POST, Please elaborate on what specifically you want to discuss about Refal and Valentin Turchin and your own thoughts and experiences. Вы также должны предоставить перевод на английский язык, потому что не все могут говорить по-русски. You should always elaborate on your opinions rather than just spilling the soykaf.)
Agent Richard Gill · 2022-10-01 04:23
>>32888 http://www.refal.net/doc/turchin/dag/dag.html
limited · 2022-10-01 08:13
>>32888 How neat, a REFAL thread in /λ/. I learned from this resource: http://refal.botik.ru/book/html/ I've taken an interest in the language, and want to implement it, but admit I've found its pattern matching algorithm difficult to mull over in detail. I really would benefit from being able to study an existing implementation, something I usually never need, but there are none of which I'm aware. Because of this, I've focussed on all other aspects of the planned implementation. Part of my problem was wanting a clean implementation which was efficient and which could be used from its hosting language with a pleasant interface; I've since realized this is unreasonable for a first draft, but still it beckons me. I figure compiling the patterns to a specialized virtual machine would help for efficiency, but I've also not found any libraries in the languages I use suitable for implementing REFAL without much work on my part, for this first draft. There's a program I'd very much like to implement in REFAL, since it's based around doubly-linked lists; the catch, however, is that my program does benefit from being able to use object identity to more efficiently link related structures. This requires indirection and searching in REFAL, but is no deal-breaker. There are so many things I'd like to do, and I've already planned this program's structure and key aspects of its translation to REFAL, but I'm paralyzed by the lack of an implementation. Ironically, I wanted to implement REFAL before other, larger languages. I clearly underestimated the difficulty of implementing an alien core. I've left my REFAL work fall to other work, but I'd love to revisit it. I'd even collaborate with others to see this through.
Milner · 2022-10-01 09:09
>>32891 >but admit I've found its pattern matching algorithm difficult to mull over in detail the pattern matcher is the real magic of REFAL, I think when Turchin devised REFAL, he started with a handwritten notation, with this in mind I think REFAL could be extended to handle term matching on graphs and lazy evaluation patterns what attracted me to REFAL was Turchins theory of compilation and metasystem transitions, it's a completely novel idea in computation that I'm not sure has been fully fleshed out. Have you read the Phenonema of Science and the Inertia of Fear? His cybernetic theories are laid out there.
Jet Black · 2022-10-03 01:12
>>32893 >the pattern matcher is the real magic of REFAL Yes, but that doesn't change that I have issues implementing it. I should probably take another attempt at it soon, just using an inefficient interpreting approach. >I think when Turchin devised REFAL, he started with a handwritten notation That would be the proper way to do it, just as with APL. >with this in mind I think REFAL could be extended to handle term matching on graphs and lazy evaluation patterns My design extended REFAL to self-manipulation without the contortions Turchin used. I'd be wary of adding new data structures, however, and damaging the system's uniformity. >what attracted me to REFAL was Turchins theory of compilation and metasystem transitions, it's a completely novel idea in computation that I'm not sure has been fully fleshed out. I often think back to it when I mull over how pathetic current compilers are. >Have you read the Phenonema of Science and the Inertia of Fear? His cybernetic theories are laid out there. I've not.
Neuromancer · 2022-10-03 04:01
>>32915 here is the pdf Turchin's theory of information, unlike Shannon's or Wiener's starts from an organisms point of view
Lord Nikon · 2022-11-20 19:11
>>33398 I'm working through a visual REFAL of sorts, this is the simplest classifier automata for pattern matching, a decision tree I'd be down to implement something more orthodox, I spec'd some stuff out in Common Lisp for a REFAL implementation
Unknown · 2022-11-22 23:52
>>33423 Alright. I've already written the doubly-linked list library we can use. I should probably upload some improvements I've made recently, but nothing major will change: http://verisimilitudes.net/2020-12-21 gopher://verisimilitudes.net/12020-12-21 I figure our first implementation will be an inefficient interpreter, but as soon as I can study something that works, I'll be able to work to improve it. Efficiently compiling REFAL is probably akin to compiling extended regular expressions, with obvious differences.
Pulse · 2022-11-25 19:47
>>33439 for a compiler would it be more fitting to use a pointer-based tree representation of data structures like AST's of functions for substitution in the compiler? I'm trying to grok tree-rewriting and thinking about how this would be done in REFAL vs Lisp vs C
Sipho Nkosi · 2022-11-27 18:41
>>33473 I bring this up because even in a lisp implementation, the generated assembly will be referring to a pointers in the trees during traversal and matching I'm interested in what this looks like at the hardware level for speed, a REFAL machine if you will, even it ends up being a virtual machine
limited · 2022-11-27 23:16
>>33473 >>33500 Part of my plan for REFAL in Common Lisp, which I call CLEF, is to have a representation of code that allows REFAL programs to easily modify REFAL programs. A pattern should be represented as a doubly-linked list containing the special matching symbols, numbers, symbols, characters, and other doubly-linked lists; by now I forget precisely how I wanted to represent function calls, but those could be represented by either a function object type or something like FUNCALL in the pattern. Now, A REFAL function would be a doubly-linked list of doubly-linked lists holding such patterns and their consequences; extensions could add another element to such lists, but those can come later. The only part of this which gave me any grief was implementing the core function that takes a single such pattern and attempts to match it against the parameter. I wanted it to be pretty, efficient, suitable as an interface for Lisp code, and many other unreasonable goals for what should've been a prototype. I've accepted the first version should be but an interpreter which CONSes wildly and other undesirable things. We can discuss a compiler later. The ideas I had for such will slowly return to me.
Bobby Newmark · 2022-11-28 11:33
>>33501 can you draw or pint out of a representation of a REFAL program in your doubly linked list in lisp?
H.R. Giger · 2022-11-28 19:20
>>33504 Sure. I'll use S-expression notation, but remember these are doubly-linked lists: Pal { = True; s.1 = True; s.1 e.2 s.1 = <Pal e.2>; e.1 = False; } (((NIL) (True)) ((#<CLEF::SYMBOL :SYMBOL 1>) (True)) ((#<CLEF::SYMBOL :SYMBOL 1> #<CLEF::EXPRESSION :SYMBOL 2> #<CLEF::SYMBOL :SYMBOL 1>) ((#<FUNCTION Pal> #<CLEF::EXPRESSION :SYMBOL 2>))) ((#<CLEF::EXPRESSION :SYMBOL 1>) (False))) This representation can be extended easily: Pre-alph {s.1 s.1 = T; s.1 s.2, <Alphabet>: e.A s.1 e.B s.2 e.C = T; e.1 = F; } (((#<CLEF::SYMBOL :SYMBOL 1> #<CLEF::SYMBOL :SYMBOL 1>) (T)) ((#<CLEF::SYMBOL :SYMBOL 1> #<CLEF::SYMBOL :SYMBOL 2>) (Where ...) (...)) ((#<CLEF::EXPRESSION :SYMBOL 1>) (F)))
Ivan Horvat · 2024-04-20 23:22
>>32891 >I really would benefit from being able to study an existing implementation, something I usually never need, but there are none of which I'm aware. I finally found one: https://github.com/bmstu-iu9/refal-5-lambda Frustratingly, the earlier screenshots appear to be from this related reference: https://bmstu-iu9.github.io/refal-5-lambda/3-basics.en.html That would've been nice to know, years ago. Anyway, now I can study this to get an idea of how to implement REFAL, so perhaps I'll get that done this year.