Live data from Hacker News

Porting a library to a different language with a sentence

randomlabs.ai

1–10 of 21 posts

Re: Porting a library to a different language with a sentence

#2
> If you're reading this you probably have some idea of what slate is.

Tip for anyone writing technical/product blogs: never assume readers know what your product is. They probably came in for the first time from a random link on some site like HN and this is your first (and maybe only) opportunity to get that elevator pitch in. I think this particular example is a good one, in that they immediately provide a one-sentence "refresher" that gives the rest of the post some context.

Might be also worthwhile considering a more memorable/distinctive name, unless of course this is only aimed at those who are actively and aggressively following developments in that space. The post piqued my interest enough to make me vaguely think, hmmm, I might follow that up some time in the future when I'm less busy however if I fail to bookmark it and assuming the name 'slate' loosely sticks in my head, then a Google search for 'slate', 'slate ai' or even 'slate ai agent' isn't going to bring me back to this product again.

Re: Porting a library to a different language with a sentence

#3
I was looking for signs that the tests and examples worked afterwards. Those are missing.

Its javascript to typescript, which unless I'm missing something, can be done with `mv foo.js foo.ts`. No examples of any transforms done by the tool.

And it wasn't one sentence, it was a sequence of questions and answers.

I guess they started with the title for the blog post and didn't really worry about showing whether it did anything useful or not.

Re: Porting a library to a different language with a sentence

#4

I was looking for signs that the tests and examples worked afterwards. Those are missing. Its javascript to typescript, which unless I'm missing something, can be done with `mv foo.js foo.ts`. No examples of any transforms done by the tool. And it wasn't one sentence, it was a sequence of questions and answers. I guess they started with the title for the blog post and didn't really worry about showing whether it did…

it was Python -> Typescript

Re: Porting a library to a different language with a sentence

#5

I was looking for signs that the tests and examples worked afterwards. Those are missing. Its javascript to typescript, which unless I'm missing something, can be done with `mv foo.js foo.ts`. No examples of any transforms done by the tool. And it wasn't one sentence, it was a sequence of questions and answers. I guess they started with the title for the blog post and didn't really worry about showing whether it did…

Python to typescript is far more impressive. Assuming it's working of course.

Re: Porting a library to a different language with a sentence

#6
I cannot find any link to a repository with that ported library. I can't imagine why you wouldn't share this exciting port, unless of course the code is not that great?

And as a sidenote, why would you ever hijack the up/down cursor keys on a web page? There are still people out there on actual computers which use them for scrolling.

Re: Porting a library to a different language with a sentence

#7

I was looking for signs that the tests and examples worked afterwards. Those are missing. Its javascript to typescript, which unless I'm missing something, can be done with `mv foo.js foo.ts`. No examples of any transforms done by the tool. And it wasn't one sentence, it was a sequence of questions and answers. I guess they started with the title for the blog post and didn't really worry about showing whether it did…

> .. excluding all tests and examples, ..

How would you verify that the ported code actually works if you don't port the tests and examples?

I see tremendous use in a tool that could be used to port "any" library to any language. I'm very skeptical if this works if the library itself depends on other language specific libraries, ... but we'll see.

If you'd seriously want to use that port in production it only makes sense to port the tests and examples. How would you verify the ported code works otherwise? This also means that if the original library has bad test coverage.. you have too.

Re: Porting a library to a different language with a sentence

#8
post #7

I was looking for signs that the tests and examples worked afterwards. Those are missing. Its javascript to typescript, which unless I'm missing something, can be done with `mv foo.js foo.ts`. No examples of any transforms done by the tool. And it wasn't one sentence, it was a sequence of questions and answers. I guess they started with the title for the blog post and didn't really worry about showing whether it did…

> .. excluding all tests and examples, .. How would you verify that the ported code actually works if you don't port the tests and examples? I see tremendous use in a tool that could be used to port "any" library to any language. I'm very skeptical if this works if the library itself depends on other language specific libraries, ... but we'll see. If you'd seriously want to use that port in production it only makes s…

It's much more convincing evidence that the port worked if you run the same tests and examples as before. If you've let the llm change the tests too it's very hard to tell whether the new codebase does the same thing as the original.

Re: Porting a library to a different language with a sentence

#9

I was looking for signs that the tests and examples worked afterwards. Those are missing. Its javascript to typescript, which unless I'm missing something, can be done with `mv foo.js foo.ts`. No examples of any transforms done by the tool. And it wasn't one sentence, it was a sequence of questions and answers. I guess they started with the title for the blog post and didn't really worry about showing whether it did…

Python to typescript is far more impressive. Assuming it's working of course.

Ah yes, reading fail on my part. Yes, successfully compiling python to typescript would be a headache. I think some things would essentially have to turn into eval of strings. Though not if the project was sufficiently uninteresting python.

Re: Porting a library to a different language with a sentence

#10
post #7

Earlier quoted context omitted.

> .. excluding all tests and examples, .. How would you verify that the ported code actually works if you don't port the tests and examples? I see tremendous use in a tool that could be used to port "any" library to any language. I'm very skeptical if this works if the library itself depends on other language specific libraries, ... but we'll see. If you'd seriously want to use that port in production it only makes s…

It's much more convincing evidence that the port worked if you run the same tests and examples as before. If you've let the llm change the tests too it's very hard to tell whether the new codebase does the same thing as the original.

Claude Sonnet has a funny habit of fixing test failures by deleting the failing tests.
Post reply on HN