home.social

#declarativeprogramming — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #declarativeprogramming, aggregated by home.social.

fetched live
  1. Declarative all the way down: Building PRONOM signatures with JSONID

    by @beet_keeper

    PRONOM signatures are a form of declarative language, you describe the anticipated behavior in PRONOM’s regular expression syntax and tools like DROID, FIDO, and Siegfried will interpret those instructions and attempt to match them against different files to return a file format identification.

    Normally, you will write PRONOM signatures by hand but doing so for file formats based on other file format building blocks can lead to inconsistencies. Bertrand Caron previously also recognized this in the XML formats that are described with PRONOM signatures on Wikidata.

    XML can use single quotes ‘ (hex: 0x27) and double quotes ” (hex: 0x22) for attribute data, and so, do we make a PRONOM signature with multiple sequences anticipating the use of either?

    The answer is more often than not likely to be yes, because the appearance of these values are often helpful for identifying boundaries for strings that we know must exist.

    But the more file formats that we need to add to PRONOM that are based on foundational formats like XML, or JSON, or similar, the more inconsistencies will creep in, such as sequences that are looking specifically for one byte sequence over another.

    The issue extends further if file formats allow data to appear at the beginning of file, or we need to account for a variable amount of white-space, or we want to start thinking about multi-byte character encoding.

    We can, and in the XML issue described by myself and Caron, I think the recommendation is very much to create editorial standards for signatures for file formats based on other baseline, structured data formats like XML, JSON, YAML, and so on.

    And standards are well and good, but what if tooling could help us?

    For JSON this is exactly what I have tried to do in JSONID.

    What does this feature look like? And what does it get us? Let’s take a look.


    #declarativeProgramming #digipres #DigitalPreservation #DROID #FIDO #FileFormatIdentification #FileFormats #JSON #jsonid #JSONL #NTTW #NTTW9 #PRONOM #RDM #ResearchData #siegfried #StructuredData #structuredText #TOML #YAML
  2. Declarative all the way down: Building PRONOM signatures with JSONID

    by @beet_keeper

    PRONOM signatures are a form of declarative language, you describe the anticipated behavior in PRONOM’s regular expression syntax and tools like DROID, FIDO, and Siegfried will interpret those instructions and attempt to match them against different files to return a file format identification.

    Normally, you will write PRONOM signatures by hand but doing so for file formats based on other file format building blocks can lead to inconsistencies. Bertrand Caron previously also recognized this in the XML formats that are described with PRONOM signatures on Wikidata.

    XML can use single quotes ‘ (hex: 0x27) and double quotes ” (hex: 0x22) for attribute data, and so, do we make a PRONOM signature with multiple sequences anticipating the use of either?

    The answer is more often than not likely to be yes, because the appearance of these values are often helpful for identifying boundaries for strings that we know must exist.

    But the more file formats that we need to add to PRONOM that are based on foundational formats like XML, or JSON, or similar, the more inconsistencies will creep in, such as sequences that are looking specifically for one byte sequence over another.

    The issue extends further if file formats allow data to appear at the beginning of file, or we need to account for a variable amount of white-space, or we want to start thinking about multi-byte character encoding.

    We can, and in the XML issue described by myself and Caron, I think the recommendation is very much to create editorial standards for signatures for file formats based on other baseline, structured data formats like XML, JSON, YAML, and so on.

    And standards are well and good, but what if tooling could help us?

    For JSON this is exactly what I have tried to do in JSONID.

    What does this feature look like? And what does it get us? Let’s take a look.


    #declarativeProgramming #digipres #DigitalPreservation #DROID #FIDO #FileFormatIdentification #FileFormats #JSON #jsonid #JSONL #NTTW #NTTW9 #PRONOM #RDM #ResearchData #siegfried #StructuredData #structuredText #TOML #YAML
  3. @kentpitman

    Thank you!
    Indeed your post is a good read and instructive on many counts.

    Three notes:

    (1)
    «=====
    (LOOP FOR X FROM 3 TO 5 COLLECT X)
    (3 4 5)

    (LOOP COLLECT X FOR X FROM 3 TO 5)
    (3 4 5 6)
    =====»

    This is an important example (and a good catch), which has "procedural" written all over it and it shows that `loop' isn't actually declarative—it can only be viewed as such, carefully.

    It seems to me that it would be interesting to fix the second case, rather than prohibit it, _but_ it may be difficult to justify the effort.
    (Regrettably, I can't recall exactly what the _current_ Common Lisp specification says, but I'll check later.)

    (2)
    Yes, I have always found the design and history of the pathname system very instructive, in more ways than I can elaborate now.
    And let no one forget about logical pathnames, too.

    "LOSSAG" fit in a single 36-bit word, didn't it?

    As a footnote, a long time ago I was something of a user of old IBM mainframe operating systems like VM/370¹, which did not have directories and separated a file name from a file type with a space (each up to eight characters, no lower case).
    _________
    ¹ Bulgaria was lagging behind the technological times then.

    (3)
    It's interesting to mention an emulator in this context.
    I can see a weak analogy to historical reconstructions.
    (There are many people who do them, mostly as recreation.
    I have been to some, watching horse riders shoot arrows and sheltering in a 7th-century-model tent from the rain.)

    #CommonLisp
    #ComputerHistory
    #DeclarativeProgramming
    #DeclarativeStyle
    #History
    #Lisp
    #ProceduralProgramming
    #ProceduralStyle

    @screwlisp

  4. @kentpitman

    Thank you!
    Indeed your post is a good read and instructive on many counts.

    Three notes:

    (1)
    «=====
    (LOOP FOR X FROM 3 TO 5 COLLECT X)
    (3 4 5)

    (LOOP COLLECT X FOR X FROM 3 TO 5)
    (3 4 5 6)
    =====»

    This is an important example (and a good catch), which has "procedural" written all over it and it shows that `loop' isn't actually declarative—it can only be viewed as such, carefully.

    It seems to me that it would be interesting to fix the second case, rather than prohibit it, _but_ it may be difficult to justify the effort.
    (Regrettably, I can't recall exactly what the _current_ Common Lisp specification says, but I'll check later.)

    (2)
    Yes, I have always found the design and history of the pathname system very instructive, in more ways than I can elaborate now.
    And let no one forget about logical pathnames, too.

    "LOSSAG" fit in a single 36-bit word, didn't it?

    As a footnote, a long time ago I was something of a user of old IBM mainframe operating systems like VM/370¹, which did not have directories and separated a file name from a file type with a space (each up to eight characters, no lower case).
    _________
    ¹ Bulgaria was lagging behind the technological times then.

    (3)
    It's interesting to mention an emulator in this context.
    I can see a weak analogy to historical reconstructions.
    (There are many people who do them, mostly as recreation.
    I have been to some, watching horse riders shoot arrows and sheltering in a 7th-century-model tent from the rain.)

    #CommonLisp
    #ComputerHistory
    #DeclarativeProgramming
    #DeclarativeStyle
    #History
    #Lisp
    #ProceduralProgramming
    #ProceduralStyle

    @screwlisp

  5. A primary source is a beautiful thing.

    *

    In my not so humble opinion, the finest uses of the Loop facility are those without `do' clauses.
    Once I realized those are best viewed as if expressed in declarative style, I was no longer bothered by the "lack of parentheses".

    Note that three years later Common Lisp specified `loop' while reserving forms with atoms in them, so it did specify enough for a REPL "in four".
    (In REverse PoLish, of course;
    WHOIS says that re.pl was created on 2000-03-14.)

    #Alchemy
    #CommonLisp
    #DeclarativeProgramming
    #DeclarativeProgrammingStyle
    #Lisp
    #Loop
    #LoopFacility

    @kentpitman @screwlisp

  6. A primary source is a beautiful thing.

    *

    In my not so humble opinion, the finest uses of the Loop facility are those without `do' clauses.
    Once I realized those are best viewed as if expressed in declarative style, I was no longer bothered by the "lack of parentheses".

    Note that three years later Common Lisp specified `loop' while reserving forms with atoms in them, so it did specify enough for a REPL "in four".
    (In REverse PoLish, of course;
    WHOIS says that re.pl was created on 2000-03-14.)

    #Alchemy
    #CommonLisp
    #DeclarativeProgramming
    #DeclarativeProgrammingStyle
    #Lisp
    #Loop
    #LoopFacility

    @kentpitman @screwlisp

  7. Ah, the riveting saga of declarative programming, as told by the Shen 4th Edition—because who wouldn't want to time-travel to the future for a book 📚 that sounds like a high-tech bedtime story? 😴 Prepare for an exhilarating read, right after you figure out how to contact their sales department for an ad spot! 🤑
    shenlanguage.org/TBoS/tbos_15. #declarativeprogramming #Shen4thEdition #techbooks #bedtimeStory #salesdepartment #HackerNews #ngated

  8. Ah, the riveting saga of declarative programming, as told by the Shen 4th Edition—because who wouldn't want to time-travel to the future for a book 📚 that sounds like a high-tech bedtime story? 😴 Prepare for an exhilarating read, right after you figure out how to contact their sales department for an ad spot! 🤑
    shenlanguage.org/TBoS/tbos_15. #declarativeprogramming #Shen4thEdition #techbooks #bedtimeStory #salesdepartment #HackerNews #ngated

  9. Declarative programming for Digital Preservationists @ NTTW8


    by @beet_keeper

    youtube.com/watch?v=GkjQgU0Aq5

    Just released on the No Time to Wait (NTTW) YouTube channel is my presentation from NTTW8 in Karlsruhe, Germany. (Slides also available here).

    The presentation follows up on my proposal for iPRES 2024 and allowed me to present parts of what was, in the end, a pretty significant paper (in terms of word count).

    Sticking the

    #Code #Coding #Conferences #declarative #declarativeLanguages #declarativeProgramming #jsonid #KVAL #kvalAccessLanguage #NoTimeToWait #NTTW #NTTW8 #NTTW9 #Programming #programmingParadigms #software #SoftwareDevelopment #talks

  10. Declarative programming for Digital Preservationists @ NTTW8


    by @beet_keeper

    youtube.com/watch?v=GkjQgU0Aq5

    Just released on the No Time to Wait (NTTW) YouTube channel is my presentation from NTTW8 in Karlsruhe, Germany. (Slides also available here).

    The presentation follows up on my proposal for iPRES 2024 and allowed me to present parts of what was, in the end, a pretty significant paper (in terms of word count).

    Sticking the

    #Code #Coding #Conferences #declarative #declarativeLanguages #declarativeProgramming #jsonid #KVAL #kvalAccessLanguage #NoTimeToWait #NTTW #NTTW8 #NTTW9 #Programming #programmingParadigms #software #SoftwareDevelopment #talks

  11. How to write declarative TypeScript Code?

    Key Points:
    ➡️ Declarative programming focuses on defining the desired outcome rather than the specific steps to achieve it.
    ➡️ It simplifies code by abstracting control flow and state management.
    ➡️ Example of imperative: Manually iterating over an array to filter even numbers.
    ➡️ Example of declarative: Using the filter function to achieve the same result.

    typescript.tv/hands-on/how-to-

  12. How to write declarative TypeScript Code?

    Key Points:
    ➡️ Declarative programming focuses on defining the desired outcome rather than the specific steps to achieve it.
    ➡️ It simplifies code by abstracting control flow and state management.
    ➡️ Example of imperative: Manually iterating over an array to filter even numbers.
    ➡️ Example of declarative: Using the filter function to achieve the same result.

    #TypeScript #Programming #DeclarativeProgramming

    typescript.tv/hands-on/how-to-

  13. Survey of Theme One Program • 6
    inquiryintoinquiry.com/2024/02

    This is a Survey of resources for the Theme One Program I worked on all through the 1980s. The aim was to develop fundamental algorithms and data structures for integrating empirical learning with logical reasoning. I had earlier developed separate programs for basic components of those tasks, namely, two‑level formal language learning and propositional constraint satisfaction, the latter using an extension of C.S. Peirce's logical graphs as a syntax for propositional logic. Thus arose the question of how well it might be possible to get “empiricist” and “rationalist” modes of operation to cooperate. The long-term vision is the design and implementation of an Automated Research Tool able to double as a platform for Inquiry Driven Education.

    Please follow the above link for the full set of resources.
    A collection of articles on the core ideas is linked below.

    Wiki Hub —

    Theme One Program • Overview
    oeis.org/wiki/Theme_One_Progra

    Documentation —

    Theme One Program • Pascal Source Code
    academia.edu/5210987/Theme_One

    Theme One Program • User Guide
    academia.edu/5211369/Theme_One

    Theme One Program • Exposition
    oeis.org/wiki/Theme_One_Progra

    Applications —

    Applications of a Propositional Calculator • Constraint Satisfaction Problems
    academia.edu/4727842/Applicati

    Exploratory Qualitative Analysis of Sequential Observation Data
    oeis.org/wiki/User:Jon_Awbrey/

    References —

    An Architecture for Inquiry • Building Computer Platforms for Discovery
    academia.edu/1270327/An_Archit

    Exploring Research Data Interactively • Theme One : A Program of Inquiry
    academia.edu/1272839/Exploring

    #Peirce #Logic #LogicalGraphs #ThemeOneProgram
    #BooleanSatisfiability #DeclarativeProgramming

  14. Survey of Theme One Program • 6
    inquiryintoinquiry.com/2024/02

    This is a Survey of resources for the Theme One Program I worked on all through the 1980s. The aim was to develop fundamental algorithms and data structures for integrating empirical learning with logical reasoning. I had earlier developed separate programs for basic components of those tasks, namely, two‑level formal language learning and propositional constraint satisfaction, the latter using an extension of C.S. Peirce's logical graphs as a syntax for propositional logic. Thus arose the question of how well it might be possible to get “empiricist” and “rationalist” modes of operation to cooperate. The long-term vision is the design and implementation of an Automated Research Tool able to double as a platform for Inquiry Driven Education.

    Please follow the above link for the full set of resources.
    A collection of articles on the core ideas is linked below.

    Wiki Hub —

    Theme One Program • Overview
    oeis.org/wiki/Theme_One_Progra

    Documentation —

    Theme One Program • Pascal Source Code
    academia.edu/5210987/Theme_One

    Theme One Program • User Guide
    academia.edu/5211369/Theme_One

    Theme One Program • Exposition
    oeis.org/wiki/Theme_One_Progra

    Applications —

    Applications of a Propositional Calculator • Constraint Satisfaction Problems
    academia.edu/4727842/Applicati

    Exploratory Qualitative Analysis of Sequential Observation Data
    oeis.org/wiki/User:Jon_Awbrey/

    References —

    An Architecture for Inquiry • Building Computer Platforms for Discovery
    academia.edu/1270327/An_Archit

    Exploring Research Data Interactively • Theme One : A Program of Inquiry
    academia.edu/1272839/Exploring

    #Peirce #Logic #LogicalGraphs #ThemeOneProgram
    #BooleanSatisfiability #DeclarativeProgramming

  15. @evan oh no! I only just realised that when you say "Noun" you mean that types are sort of like nouns and terms of the types are sort of like names, whereas functions over types are sort of like verbs and interfaces are sort of like "verbers"!

    I thought that we're taking about language processing related domain!

    If we aren't, then I'm heavily in "it depends" camp. There is #ExpressionProblem, so while picking tools to encode your problem domain, you have to pick the closeness of extending "nouns" with more "verbs" or allowing a "verb" to work on more "nouns" based on the problem domain. There's no right answer and no reasonable way to prefer one over the other.

    But from the standpoint of ease of understanding, facilitated the most by #DeclarativeProgramming, I would pick option 1 because it doesn't rely on traits, is explicit and separates "algorithms" (verb) and "data structures" (Noun) so that people can understand them independently.

  16. @evan oh no! I only just realised that when you say "Noun" you mean that types are sort of like nouns and terms of the types are sort of like names, whereas functions over types are sort of like verbs and interfaces are sort of like "verbers"!

    I thought that we're taking about language processing related domain!

    If we aren't, then I'm heavily in "it depends" camp. There is #ExpressionProblem, so while picking tools to encode your problem domain, you have to pick the closeness of extending "nouns" with more "verbs" or allowing a "verb" to work on more "nouns" based on the problem domain. There's no right answer and no reasonable way to prefer one over the other.

    But from the standpoint of ease of understanding, facilitated the most by #DeclarativeProgramming, I would pick option 1 because it doesn't rely on traits, is explicit and separates "algorithms" (verb) and "data structures" (Noun) so that people can understand them independently.

  17. Survey of Theme One Program
    inquiryintoinquiry.com/2023/03

    This is a Survey of resources for the Theme One Program I worked on all through the 1980s. The aim was to develop fundamental algorithms and data structures for integrating empirical learning with logical reasoning. I had earlier developed separate programs for basic components of those tasks, namely, 2-level formal language learning and propositional constraint satisfaction, the latter using an extension of C.S. Peirce's logical graphs as a syntax for propositional logic. Thus arose the question of how well it might be possible to get “empiricist” and “rationalist” modes of operation to cooperate. The long-term vision is the design and implementation of an Automated Research Tool able to double as a platform for Inquiry Driven Education.

    Please follow the above link for the full set of resources. An initial sample is linked below.

    Wiki Hub —

    Theme One Program • Overview
    oeis.org/wiki/Theme_One_Progra

    Documentation —

    Theme One Program • Pascal Source Code
    academia.edu/5210987/Theme_One

    Theme One Program • User Guide
    academia.edu/5211369/Theme_One

    Theme One Program • Exposition
    oeis.org/wiki/Theme_One_Progra

    Applications —

    Applications of a Propositional Calculator • Constraint Satisfaction Problems
    academia.edu/4727842/Applicati

    Exploratory Qualitative Analysis of Sequential Observation Data
    oeis.org/wiki/User:Jon_Awbrey/

    References —

    An Architecture for Inquiry • Building Computer Platforms for Discovery
    academia.edu/1270327/An_Archit

    Exploring Research Data Interactively • Theme One : A Program of Inquiry
    academia.edu/1272839/Exploring

    #Peirce #Logic #LogicalGraphs #ThemeOneProgram #IdeaProcessor
    #BooleanSatisfiability #CactusLanguage #DeclarativeProgramming

  18. Survey of Theme One Program
    inquiryintoinquiry.com/2023/03

    This is a Survey of resources for the Theme One Program I worked on all through the 1980s. The aim was to develop fundamental algorithms and data structures for integrating empirical learning with logical reasoning. I had earlier developed separate programs for basic components of those tasks, namely, 2-level formal language learning and propositional constraint satisfaction, the latter using an extension of C.S. Peirce's logical graphs as a syntax for propositional logic. Thus arose the question of how well it might be possible to get “empiricist” and “rationalist” modes of operation to cooperate. The long-term vision is the design and implementation of an Automated Research Tool able to double as a platform for Inquiry Driven Education.

    Please follow the above link for the full set of resources. An initial sample is linked below.

    Wiki Hub —

    Theme One Program • Overview
    oeis.org/wiki/Theme_One_Progra

    Documentation —

    Theme One Program • Pascal Source Code
    academia.edu/5210987/Theme_One

    Theme One Program • User Guide
    academia.edu/5211369/Theme_One

    Theme One Program • Exposition
    oeis.org/wiki/Theme_One_Progra

    Applications —

    Applications of a Propositional Calculator • Constraint Satisfaction Problems
    academia.edu/4727842/Applicati

    Exploratory Qualitative Analysis of Sequential Observation Data
    oeis.org/wiki/User:Jon_Awbrey/

    References —

    An Architecture for Inquiry • Building Computer Platforms for Discovery
    academia.edu/1270327/An_Archit

    Exploring Research Data Interactively • Theme One : A Program of Inquiry
    academia.edu/1272839/Exploring

    #Peirce #Logic #LogicalGraphs #ThemeOneProgram #IdeaProcessor
    #BooleanSatisfiability #CactusLanguage #DeclarativeProgramming

  19. Preliminary #CallForPapers #PPDP2023 (Principles and Practice of Declarative Programming) "brings together researchers from the declarative programming communities, including those ... in the logic, constraint and functional programming paradigms, but also ... other paradigms such as visual programming, executable specification languages, database languages, AI languages and knowledge representation languages used, for example, in the semantic web" ppdp2023.webs.upv.es/ #DeclarativeProgramming

  20. Preliminary #CallForPapers #PPDP2023 (Principles and Practice of Declarative Programming) "brings together researchers from the declarative programming communities, including those ... in the logic, constraint and functional programming paradigms, but also ... other paradigms such as visual programming, executable specification languages, database languages, AI languages and knowledge representation languages used, for example, in the semantic web" ppdp2023.webs.upv.es/ #DeclarativeProgramming