Better HN
topnewbestaskshowjobs
Log inSign up

pratikdeoghare

41 karma · joined Jan 1, 2024 (2y ago) · 41 submissions

https://pratik.deoghare.com
Submissions

1.

A Tour of Barkdown(pratik.deoghare.com ↗)

1 points · by pratikdeoghare · 5d ago · discuss

2.

Roman Numerals and the Symptom of Bad Design(pratik.deoghare.com ↗)

1 points · by pratikdeoghare · 1w ago · discuss

3.

Missing Tools of Literate Programming(pratik.deoghare.com ↗)

4 points · by pratikdeoghare · 1w ago · discuss

comment 2w ago · link · parent

A push in the right direction.

Tokens are a resource. We should use as few as possible (Tokengolfing?).

comment 2w ago · link · parent

One artificial example that can generate exponential number of states is this.

You have a list of sets and their subsets below them shown on screen. Now you take one element from one of the sets and add it to another set want things updated, this will trigger exponential computation. Since we (human) can't really visually look at all the exponential subsets anyway it will be not a very useful visulalization.

So exponential state space will be a problem only in the cases we don't care about it. Even then we could choose only few of the states by some criteria.

comment 2w ago · link · parent

I suspect this might almost never be a problem. Because say there are n things on the canvas and they have occupied n slots, you lift one of them and want to drop it somewhere, there are only n spots to drop it to. This gives only n next states, even though there are n! permuatations. You have to drag and drop again to reach some other state.

comment 1mo ago · link · parent

This is what I did recently.

- I wanted it to implement 5 buttons for some actions. I told Claude only about 4 of them. Then I implemented frontend/backend for the fifth one myself pretending that I just joined the project.

- I made Claude implement backend only and frontend only and then connected them myself.

I will never ship without looking. I might not look right away and ship when I am pushed. But then I will go into the code later and look anyway.

I don’t care which way the industry goes. I like looking under the hood and understanding stuff. Understanding makes you much faster because you can think inside of your head. Because I understood the code I knew just what to do when something was off. I love it when that happens.

I do feel bad when I think I don’t understand. I still go back and read high school book even though my grades were good.

comment 1mo ago · link · parent

It might help to point out to students that not all things called “number” in math are for counting/measuring.

Even before complex numbers, I was confused by negative numbers. Why negative times negative suddenly positive?

I spent time figuring that out. When complex numbers came I was ready. I knew they were not really numbers that would count something. And that they are just called numbers.

comment 1mo ago · link · parent

There is proof of this theorem in it that blew my mind some years ago [1]. Someday I want to finish reading the rest of the book.

> Starting with a given convex quadrilateral, construct a square, external to the quadrilateral, on each side. Van Aubel's theorem states that the two line segments between the centers of opposite squares are of equal lengths and are at right angles to one another.

https://en.wikipedia.org/wiki/Van_Aubel%27s_theorem

comment 1mo ago · link · parent

I used complex numbers to solve popular interview question.

It can be used to convince students that they are useful.

https://pratik.deoghare.com/complex-mars-rover.html

comment 1mo ago · link · parent

> what do I do?

Very hard question.

Your work makes you one of the very few people who really understands the problem and solution and its significance.

comment 1mo ago · link · parent

If I understand correctly, you mean something like this.

#foo`fmt.Println("Hello world!")`

instead of current

#foo{`fmt.Println("Hello world!")`} .

This would mean code can have tags too just like bags. Right now only bags can have tags and children. If you want to tag something, you have to put it in a bag. This works for tagging blogs, code, other bags.

I think the extra braces are worth suffering for uniformity like the trailing commas.

comment 1mo ago · link · parent

I think brashtag is more effective than markdown at killing those things.

Because it stops after making you a tree. Markdown takes your document all the way to html. Making it do anything else requires much work.

file.md -> markdown -> file.html

file.bt -> brashtag -> tree -> to-html -> file.html

file.bt -> brashtag -> tree -> todo-list-maker -> todo list

...

file.bt -> brashtag -> tree -> ... -> ...

Brashtag is not about code at all. Most text is already a valid brashtag. It is optimized for human writing. For example, this comment is a valid brashtag document if you surround it with #{} which can be done by a program easily.

comment 1mo ago · link · parent

> It is a competitor to JSON. Not sure what brashtag does that JSON does not. I'm not at all convinced that brashtag is simpler than JSON.

As you have noticed it is poor substitute for json. It would be cumbersome to write config file in brashtag.

> This isn't a competitor to markdown.

You can write blog post in markdown. You can write it just as elegantly in brashtag. Only brashtag does not convert the doc to html for you. It just gives you tree. You write a program that processes the tree and produces html.

Example,

Markdown: # Lorem ipsum dolor sit amet

Consectetur _adipiscing_ elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.

---

Brashtag:

#h1{Lorem ipsum dolor sit amet}

Consectetur #u{adipiscing} elit, sed do eiusmod tempor incididunt #b{ut labore et dolore} magna aliqua. Ut enim ad minim veniam.

OR you could write

#really big title{Lorem ipsum dolor sit amet}

Consectetur #super duper underline{adipiscing} elit, sed do eiusmod tempor incididunt #emphsize{ut labore et dolore} magna aliqua. Ut enim ad minim veniam.

comment 1mo ago · link · parent

I wanted to keep the famaliar things. We write code blocks with backticks in markdown and slack and everywhere so I used those. In fact I used $ signs earliar then switched to backticks.

> 'this is a bag named code with a blob, therefore it is code."

This would make #code{} a special bag. Right now no bag is special. Also it would be hard to find the closing } if somebody wrote unbalanced paren code in the bag like #code{ func main() { }.

comment 1mo ago · link · parent

What if you wanted say footnotes? html does not have it.

Imagine you could just say #footnote{This will become footnote} and have a little program that would produce html that will show it at the bottom of the page.

comment 1mo ago · link · parent

I had multiple frustrating experiences. I kept thinking I could just write things in some format in text and have some programs process it to do different things. So I created it.

See how easy it is to write programs to process brashtag [1].

I can chat with llm, interact with jupyter kernel and do literate programming from any text editor all in the same document [3].

It took me like 10 minutes to build this mermaid like thing [2].

List of frustrations:

- One day Anki crashed. --- You can just write #card{....} in a text file. Some program would read it and show flashcards in browser.

- Another day JabRef crashed. --- You can just write #bib{....} put link to a paper and its citation info there and have a program download the paper and copy the citation to bib file.

- Markdown parser processed mathjax wrong. Why keep trying different markdown parsers? Just write #h1{}, #b{} #i{} and just convert them to html tags.

- Literate programming tool I was using failed at some corner case.

- My notes were scattered across files and tools. I couldn't find anything. I tried to have a text file where sections were separated by four dashes. But that didn't allow nesting. Also, the parser I wrote for that hit corner cases. Why not just put #note{} #JIRA-334{} etc. in text file.

[1] https://github.com/PratikDeoghare/brashtag#some-programs [2] https://github.com/PratikDeoghare/brashtag/tree/master/cmd/m... [3] https://www.youtube.com/watch?v=IMXgIE0Vljg

comment 1mo ago · link · parent

I like plain text. I tolerate markdown. Markdown was designed as a shorthand for html. It gets stretched to do other stuff.

I created Brashtag [1]. It is simpler than markdown.

[1] https://github.com/PratikDeoghare/brashtag

comment 1mo ago · link · parent

I have created Brashtag language for this and other things [1].

Here I am using it as frontend to Jupyter and ollama [2].

[1] https://github.com/PratikDeoghare/brashtag

[2] https://youtu.be/IMXgIE0Vljg?si=sBmmZ1nHlbHifKBd

comment 3mo ago · link · parent

> According to a strengthening of the theorem, every finite point set (not all on one line) has at least a linear number of ordinary lines. An algorithm can find an ordinary line in a set of n points in time O(n log n). [1]

There are many such lines (think convex hull) and they are easy to find. This makes it hard to appreciate the theorem. You keep thinking oh whats the big deal.

[1] https://en.wikipedia.org/wiki/Sylvester%E2%80%93Gallai_theor...

comment 4mo ago · link · parent

Shut up and learn Common Lisp using Practical Common Lisp.

This would be my advice. Why? My own road was haphazard. Other books broaden your mind and teach you really cool tricks. This book gets you using lisp like you would say golang. But it still teaches you the lisp things and broadens your mind. Time spent choosing will be better spent reading this book. After that PAIP, On Lisp, SICP etc.

comment 4mo ago · link · parent

> but rather prompting very small tasks after you have made the initial design, something along the lines of "Create a database migration that adds column [x], not null", "add a field to the this form that will accept string value, validate it on the backend against this format, and save it to column [x]". So basically, writing code in plain English.

I find such tasks easier to just do in the programming language directly than describe them in English.

comment 4mo ago · link · parent

I suspect some companies do this to look healthy from outside.

comment 4mo ago · link · parent

If you use Brashtag notation you could insert #tk{} bag.

https://github.com/pratikdeoghare/brashtag

comment 4mo ago · link · parent

> just glorified front-ends for BibTeX

These frontends are necessary however because researchers in non-computer related fields are not trained/proficient at command line tools. Many of them need help installing software. Many of them don’t use raw text files much either. They use MS word files instead etc.

comment 5mo ago · link · parent

Totally. After studying few hundred words of Spanish, German and French I thought hmm maybe a way to level up English is to learn basics of other languages. For example Fenster is Window in German. Defenestration becomes easy guess.

comment 5mo ago · link · parent

Gell-Mann Amnesia effect

https://en.wiktionary.org/wiki/Gell-Mann_Amnesia_effect

comment 5mo ago · link · parent

When studying distributed systems you have to convince yourself that clocks cannot be relied on. It is hard to do so because all the clocks around me are always working just fine.

When this article was posted here earlier I got an idea that maybe wearing a mechanical watch for a while might help.

I bought a cheap mechanical watch. It needs manual winding daily. If you take it off your wrist it gets out of sync with the other clocks or just stops.

Few weeks with that clock convinced me.

comment 6mo ago · link · parent

> making an editor

or you could come up with a notation that works in any editor. I have [1].

> That way you can easily try different ways without deleting any text.

Sorry I haven't yet read your story. Here is how I would explore alternatives with my notation. I do this when designing software/algorithms etc.

``` Elias performed at this level for about a year. He was up for a well-deserved promotion to staff engineer. I sent him a meeting invite to go through the updated leveling framework to make sure we didn't miss anything.

#{ #{ Elias declined the meeting. } #{ Elias went to the meeting but he went late.} ... }

```

[1] https://github.com/pratikdeoghare/brashtag

comment 6mo ago · link · parent

Having such a list is great. I am all for such lists.

BUT

Some people memorize these things. Take them too seriously. You are thought stupid if you don't know them. Somewhere someone then makes a story on Jira to verify that your product does all of these things and you have to convince them that we are fine without them or we don't need all of them etc.

12