Programming

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
Ah, yeah, you got me there. The INDUSTRY doesn't like Lisp a whole lot, they prefer to make their own languages and sell them to companies. Compatibility is the big issue, since there's very little of it. I mean, Reacket has like everything you could ever want, but I guess Java just has more libraries and at the end of the day that's all most people care about.

But, you said Lisp was complicated. Are you trying to think of other arguments to cover up not properly learning it? I still think you should go get a PDF of Structure and Interpretation of Computer Programs and give it a good read. It's free you know, you can just look it up. It's a great book, it even teaches you how to make a compiler.
Dude, Lisps are super complicated compared to MLs. Having a simple grammer and structure does not a simple language make. If it did, we'd teach people programming by introducing them to Brainfuck and Golfscript.
Also, Java has TOO many libraries and stuff in my opinion, which I had previously thought was impossible.
 
lol, are you kidding me? MLs are way more complicated than Lisp. I actually have to think and plan out how I'm going to write all my programs in MLs, and if I want to do something that won't look like spaghetti code then I need to write a monad. In Lisp I can just write whatever I want since it's a declarative language and not pure (Unless you're using a pure implementation like Owl Lisp).

Come on buddy, pick up SICP, you won't regret it.
 
lol, are you kidding me? MLs are way more complicated than Lisp. I actually have to think and plan out how I'm going to write all my programs in MLs, and if I want to do something that won't look like spaghetti code then I need to write a monad. In Lisp I can just write whatever I want since it's a declarative language and not pure (Unless you're using a pure implementation like Owl Lisp).

Come on buddy, pick up SICP, you won't regret it.
Do you think that number of keywords == complexity? Because in that case, the hardest languages are all dialects of SQL.

What the fuck did you just fucking say about me, you little bitch? I’ll have you know I graduated top of my class at MIT, and I’ve been involved in numerous secret DDOSes on Linode, and I have over 300 hacks. I am trained in hacking and I’m the top hackerin Anonymous. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of anos across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You’re fucking dead, kid. I can be anywhere, anytime, and I can hack you in over seven hundred ways, and that’s just with malicious addons. Not only am I extensively trained in social engineering, but I have access to the entire arsenal of apt-get I will use it to its full extent to wipe your miserable ass off the face of the internet, you little shit. If only you could have known what unholy retribution your little “clever” comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn’t, you didn’t, and now you’re paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You’re fucking dead, kiddo.
 
Lisp? Is that the language for homosexual deviant queens?

Also, pls get back on topic. no more shallow thoughts. <3
 
Lisp? Is that the language for homosexual deviant queens?

Also, pls get back on topic. no more shallow thoughts. <3

I just want my buddy pal friend here to stop making excuses and broaden his horizons with SICP is all. He's being so stubborn!
 
I just want my buddy pal friend here to stop making excuses and broaden his horizons with SICP is all. He's being so stubborn!
I recommend that you spend some time reading the Microsoft Developer Network so that you can learn about .NET languages, which are very, very common in industry, and will make you a lot more money than the academic circlejerk that is functional programming. MSDN is full of good, intelligent people. Their HTML and CSS documentation is lacking, but for that you can always go to W3Schools.

Also, is SICP on stackexchange? I might read it if it's there.
 
Right here buddy.

My favorite languages are C# and F#. Not interested in money, I'm interested in the passion. That's why this discussion is under Deep Thought and not, um, well I guess the general board. Although programming is about in the same state as sonic fanart, I still consider programming to be a bit of an art form.
So, yeah I'm part of that academic circlejerk that is functional programming.
 
However, having said all that, I really prefer MLs. It's all the fun of functional programming with syntax similar to Python's, but absolutely nowhere near as restricted as Python. Anyone here use any MLs? I got into F# recently and now I pretty much refuse to use anything else (Though I know I need to pick up OCaml since F# is basically a stripped-down bastardized OCaml. But I just love .NET so much.)
I played around with SML a bit before trying Ocaml. I like Ocaml and I'm trying to write a warlight AI bot in it, just to cement my understanding of it.

I really like ocaml, it's my first (lasting) foray into really strong type systems.

For those who are just following along, strong typing means that all the variables and values must have a single type. Every type conversion needs to be explicit. For example, if javascript were strongly typed, this code wouldn't compile:
Code:
function get_x() { return 3; }

var y = get_x();

y();
However, as things stand, that does compile. That is a valid javascript program, and if your javascript compiler rejected it, they're not following the standards. (Unless there's some technicality I'm missing.)

With strong typing, that cannot compile because get_x returns a number and you cannot call a number as a function. With weak typing, that is a correct javascript program. It runs, and then throws an error.

At first, strong typing is a bitch and a half. It's like BSDM programming. Whips and chains. But you start to work with the type system, and things flow a lot more smoothly after that point.

See, the benefit is that probably 90% of the errors I get with other programming languages is type errors. Null pointers. I meant to pass a list of arrays, instead of an array of lists of arrays. Or my closure returns another closure that returns the object, instead of whatever I was expecting.

So when I write a program in a traditional language, it compiles right as soon as I hit save. And then I spend the next two months holding my breath, because it could crash at any moment. It doesn't crash frequently, but still, when it does, that's an afternoon down the toilet tracking down a silly bug.

When I write code in a BDSM language, I hold my breath every time I compile, and sometimes I need to compile a few times before it goes through. But when it does, I know it's working. It's such a great feeling to have a program compile, and to know it's correct even before it runs.

Now, of course, this sort of thing isn't appropriate for all situations. Sometimes, you just need to be more dynamic and go with the flow. And sometimes the extra rigidity is worth it. It depends. I think of it as working in two different mediums. Marble versus charcoal.
I'm not saying that LISP is shit, but it's bad outside of a few select domains.
See, I think that's more of a stereotype, and it's not actually borne out by any evidence. Lisp seems to excel pretty broadly. It's only specialized circumstances, like things like matlab, where it's not an effective tool.
Lisp is a turing complete language, you can do anything with it, the question is one of compatibility, maintainability, efficiency, etc. And on these metrics, lisp fails pretty damn hard.
Compatibility, maintability and efficiency are things lisp excels at. Like, all popular dynamic programming languages have FFIs. They're all pretty equal in that department. Maintainability is pretty solid for lisp. Efficiency is actually a bonus for lisp, because lisp compilers really outperform many of the popular scripting languages today.
Dude, Lisps are super complicated compared to MLs.
That's a really strange assertion. What makes you say that?
I recommend that you spend some time reading the Microsoft Developer Network so that you can learn about .NET languages, which are very, very common in industry, and will make you a lot more money than the academic circlejerk that is functional programming.
.NET as a platform seems to be lacking. And if you're talking about platforms, language matters a lot, lot less.
 
Right here buddy.

My favorite languages are C# and F#. Not interested in money, I'm interested in the passion. That's why this discussion is under Deep Thought and not, um, well I guess the general board. Although programming is about in the same state as sonic fanart, I still consider programming to be a bit of an art form.
So, yeah I'm part of that academic circlejerk that is functional programming.
There's no general board. Off-Topic is just for forum games, shitposting, and honeypots.
 
  1. https://static.kiwifarms.net/data/avatars/s/6/6333.jpg?1447645042 A moment agoDNJACK:
    can someone in the programming hread point out that julia is better than both lisp and python?
 
I actually found strong typing to be very natural, actually, helpful even. I wouldn't really call it a BDSM language as much as I'd just call it a helpful tool. Then again, that's what it was designed to be. I found it so refreshing when I began writing code and the compiler caught all my bugs instead of me having to find them myself.

I really with OCaml/F# had Haskell's function signature system though. I tried emulating it with writing a type over the function and declaring that function as a value of that type, but it just looks ugly.
like this:
type Fib = bigint -> bigint
let fib:Fib = fun n -> ...
ugly
 
I actually found strong typing to be very natural, actually, helpful even. I wouldn't really call it a BDSM language as much as I'd just call it a helpful tool. Then again, that's what it was designed to be. I found it so refreshing when I began writing code and the compiler caught all my bugs instead of me having to find them myself.
Well, it's a dispute about what qualifies as a bug. People want to say "oh, you know what I mean", or they say "well, I intended to have the receiving function handle that correctly". But yeah, for me, there was a tipping point (and this came pretty early) where I stopped fighting the type system, and started working with it.

After that, it was extremely expressive and helpful.

For example, are you familiar with the flatten function? It turns an arbitrarily nested selection of lists, and turns them into one, flat list. jQuery also does something like this (or it seems so) where you can do: $(element) or $([array of elements...]) and it treats the former as if it was $([element]).

You couldn't elegantly deal with those sort of situations with a strict type system, and you could reasonably say that, in that context, strict typing is a pain in the ass and costs more than it helps. I really just chalk up these differences to different mediums, charcoal vs marble. (Especially because jQuery deals with fuzzy, dynamic situations where you genuinely need to deal with poorly defined interfaces. That's because javascript/html/web stuff in general is soft, poorly specified pudding.)
I really with OCaml/F# had Haskell's function signature system though. I tried emulating it with writing a type over the function and declaring that function as a value of that type, but it just looks ugly.
like this:
type Fib = bigint -> bigint
let fib:Fib = fun n -> ...
ugly
I never annotate types of anything unless it's absolutely necessary. I haven't seen the rest of your program, but I'd let fib's type get inferred, because bigint -> bigint is a lot more descriptive of a type than Fib.

When writing my warlight bot (I'll post my code in a bit), I had a region_id type, and I made sure to annotate references to that, just so any functions that dealt with those IDs were properly typed. But that's more of an anomaly when dealing with an external protocol that uses integer IDs.
 
I mostly liked annotating functions just to make absolutely sure the compiler knows what I'm talking about. I guess I'm a bit paranoid about it, especially I/O stuff where the compiler inferring the types incorrectly (letting more types through than I intended) could potentially result in legitimate data corruption. Maybe.

One reason I really like the .NET framework is because it makes language interopability so natural, you don't even need an FFI. If F#'s strictness gets in the way, you could offload what you need into a library in whatever, maybe C# or even IronScheme, and it just works. That's one of the reasons I choose to use .NET despite the limitations and tradeoffs it has. I think it's a very elegant solution.
 
One reason I really like the .NET framework is because it makes language interopability so natural, you don't even need an FFI. If F#'s strictness gets in the way, you could offload what you need into a library in whatever, maybe C# or even IronScheme, and it just works. That's one of the reasons I choose to use .NET despite the limitations and tradeoffs it has. I think it's a very elegant solution.
Yeah, that sounds pretty solid. Heh, I don't actually write anything important in anything but scheme. That's my plan for interoperability: scheme.

Like, I highly recommend Chicken Scheme to anyone who wants a high level, but extremely fast programming language. It uses a really clever compilation technique that makes the compiled code fly. Like shit through a goose.

Most of all, I love its FFI.

This is what it'd look like to wrap the linux function chmod:
Code:
(foreign-declare "#include <sys/stat.h>")

(define chmod (foreign-lambda int "chmod" c-string integer32))
You compile it with "csc -s chmod.scm -o chmod.so" and then you can load it within the interpreter with (load "chmod.so"). (For most bindings, you'd need to pass in linking options when compiling. There are flags to pass arguments onto the system C compiler.)

My favorite part is that you can have inline C/C++ in your FFI code. It needs to be compiled, of course, but it's very handy.

I don't have to write C bindings so often anymore, because I'm just doing web stuff for work. But when I was doing more game stuff, it was very handy.

Edit: Attached is my warlight protocol code in ocaml. It's pretty impenetrable in places, but it seems to do the job.
 

Attachments

Last edited:
  • Like
Reactions: The Fool
I didn't mean to start a religious war. I'm sorry.

I just like Lisp because it feels very "zen" to me. It's a really fun way to program. You can write your own control structures and one you turn on the rainbow parentheses settings on any IDE reading it isn't bad at all. People who are afraid of the parens have never really given it a chance.

I hated it at too when I was introduced but I gave it an honest chance and it won me over.
 
I didn't mean too either. Nobody ever said anything was the "best" language, I was just absolutely taken back by someone literally saying they didn't want to learn something new to better understand their field of expertise. It's like, something a lolcow says. Especially when so many languages today are so heavily inspired by Lisp, especially JavaScript. It's just so useful to know.

Though speaking of, I always wanted to try Chicken. All my friends don't like it for some reason, maybe because of the giant overhead of the output C code? I never really saw that as a problem but they all tell me to use something else anyway. I had no idea you could embed C/C++ though. Does that include C++11? I'm guessing it's just whatever flag you set on your C++ compiler.
 
Though speaking of, I always wanted to try Chicken. All my friends don't like it for some reason, maybe because of the giant overhead of the output C code? I never really saw that as a problem but they all tell me to use something else anyway. I had no idea you could embed C/C++ though. Does that include C++11? I'm guessing it's just whatever flag you set on your C++ compiler.
Overhead in what way? The default compilation options just go straight to the output. "csc filename.scm -o filename" doesn't leave any C files scattered anywhere (unless you want it to, there's some option to enable that).

http://api.call-cc.org/doc/csc

Usually I write my C/C++ bindings and have a makefile maintain them. The C/C++ bindings change pretty infrequently. Most of my thinking code is in scheme and I don't bother to compile that. I just use the interpreter most of the time.
 
  • Like
Reactions: The Fool
To any programmers in webdev how did you learn to design good looking frontend web pages, all the tutorials online show shit like WIX and Squarespace and not actual coding. Im also looking for a good tutorial series that will teach me how to make a registration page with an accounts system and how to make a page where payment can happen.
(Sorry if my requests are vague I don't know what the webdev terms for these things are)
 
I learned HTML and CSS from a site called w3 schools a few years back. https://www.w3schools.com/

(Modern pages are often split between HTML, which specifies what elements go on a page, and CSS, which contains all the style descriptors which modify the elements and control appearance and positioning.)

If you want to get started with a simple static webpage (which is probably where you should start if you don't know this stuff), you'll need to run some web-server software. Apache2 or nginx are the two popular servers, and can be configured to serve static pages, php pages, and many other things. They can run on either a machine you own on your local network, or on a virtual private server (which is a VM running on a hosting provider.)

(Backing up - there are all sorts of pieces to a webserver)

1. The DNS provider, such as namecheap. This allows you to manage a domain name and DNS records, which identify your server to the world and tie it to a domain name such as (blablabla.com) (mail.blablabla.com, www.blalala.com, ...) (small ~$15 or so fee per year.)

2. The server computer itself (a spare junk machine of yours running linux (does *not* have to be fancy or even good) or a VPS). (small $5/month if VPS such as Linode. Advantage there is you don't need to fight your ISP if you have a dynamic IP address, and uptime is not horrible. With your home machine you'll have to enable port forwarding on your local network, and on your cable modem.) You'll need to learn how to mess with a Linux system (how to log in with ssh, how to wrangle filesystem permissions, how to start and stop the webserver software, how to install packages.)

3. The server software apache2 or nginx.

4. The site configuration which controls what the server software does.

5. HTML and CSS files which define your webpage layout and appearance. Once you have all this set up, you can start playing with the page and getting feedback from the computer about how it looks - this is where the learning starts.

----

Once you have a static webpage down, you should start learning a backend scripting language and how to administer a database. PHP is a pretty basic backend scripting language. Databases are used to store all the state in webpage interactions. Mariadb or mysql are generic database servers.

So, the user's webclient dials a webpage. The server then executes a PHP script on the server side. (If the PHP is configured right, the client never sees the PHP code. The PHP code assembles a dynamic HTML page based on its code, the user's HTTP request, and what's in the database. The user gets the HTML page, which contains what he sees. Then he clicks on various page elements or fills out a form, which sends variables back to the server in another HTTP request.

------

That's the 10,000 ft view. It's a bit of a journey. I'm not a sysadmin or a web developer really, I've just got infinite computer trivia banging around in my head from my own web-sites and experiments.

PS, once you have a server of your own, you can do all sorts of useful and interesting things. You can serve and store files to yourself from your own encrypted "cloud storage". You can manage academic paper libraries with webdav storage and zotero. You can run a mail-server and serve email from your own website (though there is a *LOT* of configuration and pain in that learning curve.) Once you're to the basic-competence-with-a-database stage, you can start bolting on all sorts of other software onto your website if you don't want to develop your own (though it sounds like you eventually do want to develop your own store page.)
 
Last edited:
  • Like
Reactions: King Of The Kiwis
That reminds me - while I hope to never have to deal with even a microscopic fraction of the shit this site has dealt with, I should probably at some point learn what is behind kiwiflare and the rest of the things Null/the admins have built to stay online. It deserves Matrix memes. Truly impressive.
 
  • Like
Reactions: King Of The Kiwis
Back