#declarativeprogramming — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #declarativeprogramming, aggregated by home.social.
-
Declarative all the way down: Building PRONOM signatures with JSONID
by @beet_keeperPRONOM 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 -
Declarative all the way down: Building PRONOM signatures with JSONID
by @beet_keeperPRONOM 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 -
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 -
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 -
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 -
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 -
Before concluding, I am curious: what do you think works best today for this kind of AI-assisted, exploratory coding? Are you seeing... #AI #ProgrammingLanguages #VibeCoding #DeclarativeProgramming #LLMs #HumanComputerInteraction #SoftwareDesign #FutureOfCoding #PWL 🧵 14/14
-
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! 🤑
https://shenlanguage.org/TBoS/tbos_15.html #declarativeprogramming #Shen4thEdition #techbooks #bedtimeStory #salesdepartment #HackerNews #ngated -
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! 🤑
https://shenlanguage.org/TBoS/tbos_15.html #declarativeprogramming #Shen4thEdition #techbooks #bedtimeStory #salesdepartment #HackerNews #ngated -
another version:
https://claude.ai/public/artifacts/fd4810c8-ab16-4630-a3e6-a95df0438d13
who can fix react live preview?
#javascript
#typescript
#agnostic
#declarativeprogramming
#react -
Declarative programming for Digital Preservationists @ NTTW8
by @beet_keeperhttps://www.youtube.com/watch?v=GkjQgU0Aq5Q
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
-
Declarative programming for Digital Preservationists @ NTTW8
by @beet_keeperhttps://www.youtube.com/watch?v=GkjQgU0Aq5Q
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
-
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
https://typescript.tv/hands-on/how-to-write-declarative-typescript-code/
-
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
https://typescript.tv/hands-on/how-to-write-declarative-typescript-code/
-
Survey of Theme One Program • 6
• https://inquiryintoinquiry.com/2024/02/26/survey-of-theme-one-program-6/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
• https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_OverviewDocumentation —
Theme One Program • Pascal Source Code
• https://www.academia.edu/5210987/Theme_One_Program_Pascal_Source_CodeTheme One Program • User Guide
• https://www.academia.edu/5211369/Theme_One_Program_User_GuideTheme One Program • Exposition
• https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_ExpositionApplications —
Applications of a Propositional Calculator • Constraint Satisfaction Problems
• https://www.academia.edu/4727842/Applications_of_a_Propositional_Calculator_Constraint_Satisfaction_ProblemsExploratory Qualitative Analysis of Sequential Observation Data
• https://oeis.org/wiki/User:Jon_Awbrey/Exploratory_Qualitative_Analysis_of_Sequential_Observation_DataReferences —
An Architecture for Inquiry • Building Computer Platforms for Discovery
• https://www.academia.edu/1270327/An_Architecture_for_Inquiry_Building_Computer_Platforms_for_DiscoveryExploring Research Data Interactively • Theme One : A Program of Inquiry
• https://www.academia.edu/1272839/Exploring_Research_Data_Interactively._Theme_One_A_Program_of_Inquiry#Peirce #Logic #LogicalGraphs #ThemeOneProgram
#BooleanSatisfiability #DeclarativeProgramming -
Survey of Theme One Program • 6
• https://inquiryintoinquiry.com/2024/02/26/survey-of-theme-one-program-6/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
• https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_OverviewDocumentation —
Theme One Program • Pascal Source Code
• https://www.academia.edu/5210987/Theme_One_Program_Pascal_Source_CodeTheme One Program • User Guide
• https://www.academia.edu/5211369/Theme_One_Program_User_GuideTheme One Program • Exposition
• https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_ExpositionApplications —
Applications of a Propositional Calculator • Constraint Satisfaction Problems
• https://www.academia.edu/4727842/Applications_of_a_Propositional_Calculator_Constraint_Satisfaction_ProblemsExploratory Qualitative Analysis of Sequential Observation Data
• https://oeis.org/wiki/User:Jon_Awbrey/Exploratory_Qualitative_Analysis_of_Sequential_Observation_DataReferences —
An Architecture for Inquiry • Building Computer Platforms for Discovery
• https://www.academia.edu/1270327/An_Architecture_for_Inquiry_Building_Computer_Platforms_for_DiscoveryExploring Research Data Interactively • Theme One : A Program of Inquiry
• https://www.academia.edu/1272839/Exploring_Research_Data_Interactively._Theme_One_A_Program_of_Inquiry#Peirce #Logic #LogicalGraphs #ThemeOneProgram
#BooleanSatisfiability #DeclarativeProgramming -
Answer Set Programming. ~ Vladimir Lifschitz. https://www.cs.utexas.edu/~vl/teaching/378/ASP.pdf #DeclarativeProgramming #ASP
-
Answer Set Programming. ~ Vladimir Lifschitz. https://www.cs.utexas.edu/~vl/teaching/378/ASP.pdf #DeclarativeProgramming #ASP
-
@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.
-
@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.
-
Survey of Theme One Program
• https://inquiryintoinquiry.com/2023/03/30/survey-of-theme-one-program-5/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
• https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_OverviewDocumentation —
Theme One Program • Pascal Source Code
• https://www.academia.edu/5210987/Theme_One_Program_Pascal_Source_CodeTheme One Program • User Guide
• https://www.academia.edu/5211369/Theme_One_Program_User_GuideTheme One Program • Exposition
• https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_ExpositionApplications —
Applications of a Propositional Calculator • Constraint Satisfaction Problems
• https://www.academia.edu/4727842/Applications_of_a_Propositional_Calculator_Constraint_Satisfaction_ProblemsExploratory Qualitative Analysis of Sequential Observation Data
• https://oeis.org/wiki/User:Jon_Awbrey/Exploratory_Qualitative_Analysis_of_Sequential_Observation_DataReferences —
An Architecture for Inquiry • Building Computer Platforms for Discovery
• https://www.academia.edu/1270327/An_Architecture_for_Inquiry_Building_Computer_Platforms_for_DiscoveryExploring Research Data Interactively • Theme One : A Program of Inquiry
• https://www.academia.edu/1272839/Exploring_Research_Data_Interactively._Theme_One_A_Program_of_Inquiry#Peirce #Logic #LogicalGraphs #ThemeOneProgram #IdeaProcessor
#BooleanSatisfiability #CactusLanguage #DeclarativeProgramming -
Survey of Theme One Program
• https://inquiryintoinquiry.com/2023/03/30/survey-of-theme-one-program-5/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
• https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_OverviewDocumentation —
Theme One Program • Pascal Source Code
• https://www.academia.edu/5210987/Theme_One_Program_Pascal_Source_CodeTheme One Program • User Guide
• https://www.academia.edu/5211369/Theme_One_Program_User_GuideTheme One Program • Exposition
• https://oeis.org/wiki/Theme_One_Program_%E2%80%A2_ExpositionApplications —
Applications of a Propositional Calculator • Constraint Satisfaction Problems
• https://www.academia.edu/4727842/Applications_of_a_Propositional_Calculator_Constraint_Satisfaction_ProblemsExploratory Qualitative Analysis of Sequential Observation Data
• https://oeis.org/wiki/User:Jon_Awbrey/Exploratory_Qualitative_Analysis_of_Sequential_Observation_DataReferences —
An Architecture for Inquiry • Building Computer Platforms for Discovery
• https://www.academia.edu/1270327/An_Architecture_for_Inquiry_Building_Computer_Platforms_for_DiscoveryExploring Research Data Interactively • Theme One : A Program of Inquiry
• https://www.academia.edu/1272839/Exploring_Research_Data_Interactively._Theme_One_A_Program_of_Inquiry#Peirce #Logic #LogicalGraphs #ThemeOneProgram #IdeaProcessor
#BooleanSatisfiability #CactusLanguage #DeclarativeProgramming -
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" https://ppdp2023.webs.upv.es/ #DeclarativeProgramming
-
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" https://ppdp2023.webs.upv.es/ #DeclarativeProgramming