Skip to content

Commit

Permalink
add: guile, penrose-notation, bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark1626 committed Nov 19, 2023
1 parent 15bf001 commit 653a762
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This repo is a collection of tidbits of things I learn

See the site live [here](https://mark1626.github.io/knowledge/)

This repo currently contains #441 articles
This repo currently contains #445 articles
6 changes: 6 additions & 0 deletions bookmarks/blog.rec
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,9 @@ Url: http://erikdemaine.org/
Description: Origami 3D and figurine
Tags: origami
Tags: blog

Url: https://ralphammer.com/a-quick-beginners-guide-to-drawing/
Description: Art and drawing
Tags: art
Tags: drawing

4 changes: 4 additions & 0 deletions bookmarks/category.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Url: https://www.mathstat.dal.ca/~selinger/papers.html
Description: Selinger Papers
Tags: papers

5 changes: 5 additions & 0 deletions bookmarks/fp.rec
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ Description: Programming Language Foundations in Agda
Tags: adga
Tags: haskell

Url: https://www.lisperati.com/casting.html
Description: Casting Spels in Lisp
Tags: lisp
Tags: macros

5 changes: 5 additions & 0 deletions bookmarks/tex.rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Url: https://tikz.dev/gd-usage-tikz
Description: TikZ tutorial
Tags: latex
Tags: tikz

2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
---
- ## Contents

There are #441 articles
There are #445 articles

---
- ## Categories
Expand Down
7 changes: 7 additions & 0 deletions languages/guile/guile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Guile

[Back](../languages.md)

- [Guile Assoc List](./guile_assoc_list.md)
- [Guile CLI Application](./guile_cli_app.md)
- [Guile Macros](./guile_macros.md)
20 changes: 20 additions & 0 deletions languages/guile/guile_assoc_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-
- ```scm
(define object-locations '(
(whiskey-bottle . living-room)
(bucket . living-room)
(chain . garden)
(frog . garden)
(test . player)
))
```
- > Note: Associative list created using quote are immutable
- ## Modifying assoc-lists
- ```scm
(assoc-set! object-location* object 'player)
```
-
- ## Reading
- https://www.gnu.org/software/guile/manual/html_node/Association-Lists.html
logseq.order-list-type:: number
-
16 changes: 16 additions & 0 deletions languages/guile/guile_cli_app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- ```scm
#!/usr/bin/env guile -s
!#
(use-modules (ice-9 regex))
(use-modules (ice-9 format))
(define (main)
(let ((args (program-arguments)))
(if (< (length args) 2)
(begin (display (format #f "Usage: ~s [args]\n" (car args)))
(newline)
(exit)))))
; Call the main function
(main)
```
42 changes: 42 additions & 0 deletions languages/guile/guile_macros.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Guile Macros
-
- ## Examples
- **A simple expansion**
- ```scm
; Macro
; Usage (walk west)
; Expanded to (walk-direction west)
(define-syntax walk
(syntax-rules ()
((walk direction)
(walk-direction 'direction))))
```
- **A more complex expansion that create a new procedure**
- ```scm
(define-syntax game-action
(syntax-rules ()
((game-action command subj obj place ...)
(define command (lambda (subject object)
(cond ((and (eq? *location* 'place)
(eq? 'subject 'subj)
(eq? 'object 'obj)
(have 'subj))
...)
(#t '(i cant command like that.))))))))
(game-action weld chain bucket attic
(cond ((and (have 'bucket) (set! *chain-welded* #t))
'(the chain is now securely welded to the bucket.))
(#t '(you do not have a bucket.))))
(game-action dunk bucket well garden
(cond (*chain-welded (set! *bucket-filled* #t) '(the bucket is full of water.)
(#t '(the water level is too low to reach.)))))
; Creates two new actions into the game
```
- ## Further Reading
- https://www.gnu.org/software/guile/manual/html_node/Macros.html
logseq.order-list-type:: number
-
1 change: 1 addition & 0 deletions languages/languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
9. [Typescript](./typescript/typescript.md)
10. [Java](./java/java.md)
11. [JS](./js/js.md)
11. [Guile](./guile/guile.md)

## HPC

Expand Down
22 changes: 22 additions & 0 deletions math/linear-algebra/graphical-notation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Tensor Networks

[Back](../../index.md)

Tensor Networks (Penrose diagrams) are visual diagrams to represent Tensor operations. The idea behind using a visual representations is that you can study and optimize these networks. These networks are also perhaps with some minor differences, **string diagrams. **String diagrams have been used in category theory to prove things (Curry Howard correspondence). Also formal proofs can be used to generalize optimizations
**(Linear Algebra/Differential Equations) - Tensors - Category Theory - Formal Proofs - Optimizations**

## Reading

- https://www.microsoft.com/en-us/research/publication/using-tensor-diagrams-to-represent-and-solve-geometric-problems/?from=https://research.microsoft.com/apps/pubs/default.aspx?id=79791&type=exact
- https://en.wikipedia.org/wiki/Tensor_network
- https://www.math3ma.com/blog/matrices-as-tensor-network-diagrams
- https://www.tensors.net/tutorial-4

## Papers

- Fong, Brendan and David I. Spivak. “Seven Sketches in Compositionality: An Invitation to Applied Category Theory.” *arXiv: Category Theory* (2018): n. pag.
- Bradley, Tai-Danae. “What is Applied Category Theory?” (2018).
- https://iopscience.iop.org/article/10.1088/1751-8121/aa6dc3
- https://www.mathstat.dal.ca/~selinger/papers.html#graphical
- Selinger, Peter. “A Survey of Graphical Languages for Monoidal Categories.” *arXiv: Category Theory* (2009): 289-355.
- https://www.cs.ox.ac.uk/people/bob.coecke/Selby.pdf
1 change: 1 addition & 0 deletions math/math.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

- [Normal Equations](./linear-algebra/normal-equations.md)
- [Einstein Notation](./linear-algebra/einsum.md)
- [Penrose Notation](./linear-algebra/graphical-notation.md)

## Number Theory

Expand Down

0 comments on commit 653a762

Please sign in to comment.