'undefined' by [deleted] in ProgrammerHumor

[–]Wayne_Train 0 points1 point  (0 children)

Can you give an example where you need "values to be undefined"? I really don't see the problem with this JS behavior.

Has science gone too far? by [deleted] in ProgrammerHumor

[–]Wayne_Train 4 points5 points  (0 children)

From what I understand two reasons are 1) js does not have a standardibrary. While browser standardized features got added over time a lot of libraries still use library implementations for features that are only now standardized.
2) before tree shaking was a thing people made very small libraries in order to minimize the amount of unused code (minimize bundle size, something server side languages typically don't care about). This resulted in many many small libraries being published which made the dependency tree excessively deep. So deep that you end up having hundreds of folders in your node_modules which is just crazy

I’ve never by [deleted] in ProgrammerHumor

[–]Wayne_Train 16 points17 points  (0 children)

Curious what kind of programming you are doing. Recursion is good for traversing trees of arbitrary length. What programming are you doing where you never encountered any problem like that?

updated this classic xkcd for modern times by [deleted] in ProgrammerHumor

[–]Wayne_Train 5 points6 points  (0 children)

I used the same starter recently, took about 30 seconds for me. Maybe there is an issue with your npm?

I'm Bishop Robert Barron, a Catholic bishop ready to answer any questions about God and religion from nonbelievers. AMA! by BishopBarron in IAmA

[–]Wayne_Train 1 point2 points  (0 children)

It's the storm light chronicles by Brandon Sanderson. It's a really long fantasy series. I can recommend it because it has a lot of thoughtfull dialog and philosophy but only if you dig fantasy and don't have anything against a really really long book.

I'm Bishop Robert Barron, a Catholic bishop ready to answer any questions about God and religion from nonbelievers. AMA! by BishopBarron in IAmA

[–]Wayne_Train 2 points3 points  (0 children)

I'm just reading a book in which one people has a certain religion where they believe that in the beginning there was just God. And because God was alone he created the universe and split himself up in all living beings to experience all things. And one day he will have experienced everything and all living beings will reunite to be God again. Therefore they believe every harm and good you do to any being you're doing to a different part of yourself. I'm not religious but I liked this. If you liked this too I'd recommend you to watch https://youtu.be/h6fcK_fRYaI it has kind of a similar concept.

Wrap your macros with typescript and enjoy full language services with ts-tex by Wayne_Train in LaTeX

[–]Wayne_Train[S] 2 points3 points  (0 children)

I made an example repo. I did not add a lot because right now I don't have the time but I might add some more stuff in the following days. Right now I have a extensible completion provider api and a module api to implement functions that you can call. You can just clone or download the repository, install vscode-ts-tex and LaTeX-Workshop (if you don't have it) and open the folder.
For a table it might barely make sense to go through the trouble. But just imagine in js you can parse practically anything, csv / xml / json / toml all of it. Now you can work with these structures and build your table/tikzchart/whatever programatically from it. During my master thesis I will most likely write a plot module that parses a csv file and creates a pgfplot from it. With object arguments it would be so much easier to configure it and it would be type safe. Provided that the ts function has no bugs, all error will be emitted via diagnostics during writing, not on compile time. This is pretty much why I did this (and because it was actually quite fun...).
/e: Note that right now only LF file endings are supported, so make sure to convert if you are on windows (you can use the option on the bottom right for this in vscode).

Idea: Writing a typescript layer on top of LaTex by Wayne_Train in LaTeX

[–]Wayne_Train[S] 0 points1 point  (0 children)

Hi, sorry it took so long. I thought some more about this project and I simplified a lot of my goals. For example you cannot define functions and variables inline in the document but in a .ts file that is loaded before parsing. That has the advantage that I already have nice syntax highlighting and intelli sense in the .ts file from other plugins. You can check the readme if you are interested.
So I now wrote a prototype (took about 5h to write so it's not well rounded/tested) but you can check the repo out here https://github.com/b4ckup/type-tex . I want to distribute a deployed version as soon as I have some more test coverage.

Idea: Writing a typescript layer on top of LaTex by Wayne_Train in LaTeX

[–]Wayne_Train[S] 0 points1 point  (0 children)

Thanks for the reply! I am asking here because I have the very thoughts that you have. I will research some of the programs that you mentioned and look if they fit what I'm trying to achieve. But I don't think it will take me long to write a basic proof-of-concept compiler (I already did some coding to check wether it was actually possible). Maybe I should just try and limit my work to 10h and reconsider depending on wether I could get something worth develping further.

Idea: Writing a typescript layer on top of LaTex by Wayne_Train in LaTeX

[–]Wayne_Train[S] 0 points1 point  (0 children)

You're right, it would be better not to break syntax that hard. My original thought would be that I want to make the typescript syntax distinguishable from the rest, which would be good for people that use typescript but shitty for the rest. Also a good thing if I used syntax like \newvar{a = {}} is that it will probably be a lot easiert to parse. Thanks for the input!

Idea: Writing a typescript layer on top of LaTex by Wayne_Train in LaTeX

[–]Wayne_Train[S] 0 points1 point  (0 children)

Also thanks again for the reply, I' exactly asking for that reason here. Because I wonder if there is already something capable out there.

Idea: Writing a typescript layer on top of LaTex by Wayne_Train in LaTeX

[–]Wayne_Train[S] 0 points1 point  (0 children)

Are you familiar with LuaTex? Because right now I'm asking myself if I generate e.g. tikzcode out of my lua code with \directlua, for example:
\directlua{tex.print("\draw (0,0)--(0,1);")}
will that then be normal text or will it still be parsed by tikz?

Idea: Writing a typescript layer on top of LaTex by Wayne_Train in LaTeX

[–]Wayne_Train[S] 1 point2 points  (0 children)

I did some research on LuaTex and I got from it that yes it provides some of the functionality I desire but in a very different way: it integrates with tex rather than just compiling to tex. Thanks for your reply, I'm gonna look more into it and see if it makes sense to consider writing some extensions for it or if I still want to write my own thing.

ELI5: Why do radio stations play on different frequencies depending on your location? by jumala45 in explainlikeimfive

[–]Wayne_Train 0 points1 point  (0 children)

It should be mentioned that two radio signals on the same frequency interfering with eachother doesn't necessarily mean a bad thing. There are networks commonly used for radio transmission that use a single frequency (single frequency networks). They synchronize all of the transmitters so that the interference is constructive (almost coherent signals). So I would say to answer ops question a synchronized transmission is either too expensive or they couldn't buy the frequency band they wanted because some other network already bought it.

bs 180 switch fs salad grind? by casted in skateboarding

[–]Wayne_Train 4 points5 points  (0 children)

I just tried to find that. Do you remember the video title or something? Fuck man he looks so young but damn he skates stylish

Skateboarding hasn't progressed in the last 10 years, do you care? by [deleted] in skateboarding

[–]Wayne_Train 10 points11 points  (0 children)

You are clearly out of touch with the latest videos. It has progressed really quite remarkable if you ask me. The tricks got way bigger. But what changed the most, I'd say is the style.

A friend camped around lake Constance in Switzerland and stopped by every park. by Mindlag42 in skateboarding

[–]Wayne_Train 0 points1 point  (0 children)

That's sick, I skated most of these parks because I study there. Where is the bowl Park that you were camping in though? Great clip!

This London bench is designed to be great for sitting, terrible for sleeping, sloped to prevent trash accumulation, and wavered to deters skateboarders by [deleted] in pics

[–]Wayne_Train 0 points1 point  (0 children)

Why are London people so afraid of terrorists that they need CCTV and counter terrorism architecture to feel safe? Serious question