• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:24
CET 14:24
KST 22:24
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy5ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289
Community News
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool40Weekly Cups (March 9-15): herO, Clem, ByuN win42026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12Blizzard Classic Cup - Tastosis announced as captains18
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Potential Updates Coming to the SC2 CN Server Weekly Cups (March 2-8): ByuN overcomes PvT block Weekly Cups (August 25-31): Clem's Last Straw? Weekly Cups (March 9-15): herO, Clem, ByuN win
Tourneys
World University TeamLeague (500$+) | Signups Open RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament WardiTV Team League Season 10 KSL Week 87
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026]
External Content
Mutation # 518 Radiation Zone The PondCast: SC2 News & Results Mutation # 517 Distant Threat Mutation # 516 Specter of Death
Brood War
General
Soulkey's decision to leave C9 JaeDong's form before ASL BGH Auto Balance -> http://bghmmr.eu/ [ASL21] Ro24 Preview Pt1: New Chaos ASL21 General Discussion
Tourneys
[ASL21] Ro24 Group A [Megathread] Daily Proleagues ASL Season 21 LIVESTREAM with English Commentary [BSL22] Open Qualifiers & Ladder Tours
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2
Other Games
General Games
General RTS Discussion Thread Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread Canadian Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! [Manga] One Piece
Sports
2024 - 2026 Football Thread Cricket [SPORT] Formula 1 Discussion Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
U4GM Tips Counter Enemy Gadgets Fast in Black Ops rsvsr How to Keep Reward Chains Rolling in Monopol u4gm What to Do First in MLB The Show 26 Spring
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1751 users

The Big Programming Thread - Page 906

Forum Index > General Forum
Post a Reply
Prev 1 904 905 906 907 908 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-09-15 13:47:03
September 15 2017 13:45 GMT
#18101
Looks like my class was only using ruby for project 1. Apparently the next 3 projects are now functional programming in OCaml. The language seems a little odd, since every language has been fairly similar up to this point. Except C I guess, but even that wasn't as much of an oddball as ocaml.

Anything crucial I should know? I know that everything is immutable in ocaml, which I guess is kind of the point with functional programming?

So no reassigning values within the same scope then? Any other tips from someone who had to suddenly switch to functional programming from imperative?



In other news it looks like I will be doing some research this semester! Going to be helping someone from NASA develop python scripts to predict changes to polar ice. So, climate change stuff. Sounds worthwhile and is relevant to my interests.
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
September 15 2017 15:05 GMT
#18102
On September 15 2017 22:45 travis wrote:
Looks like my class was only using ruby for project 1. Apparently the next 3 projects are now functional programming in OCaml. The language seems a little odd, since every language has been fairly similar up to this point. Except C I guess, but even that wasn't as much of an oddball as ocaml.

Anything crucial I should know? I know that everything is immutable in ocaml, which I guess is kind of the point with functional programming?

So no reassigning values within the same scope then? Any other tips from someone who had to suddenly switch to functional programming from imperative?



In other news it looks like I will be doing some research this semester! Going to be helping someone from NASA develop python scripts to predict changes to polar ice. So, climate change stuff. Sounds worthwhile and is relevant to my interests.


That project seems pretty awesome! Too bad you're going to be incredibly depressed afterwards when you figure out how quickly the ice is melting...
TRUEESPORTS || your days as a respected member of team liquid are over
Manit0u
Profile Blog Joined August 2004
Poland17698 Posts
Last Edited: 2017-09-15 16:16:23
September 15 2017 16:11 GMT
#18103
I'd love to work on such project.

And regarding your classes: why the hell would they choose OCaml to teach you functional programming instead of something that's more widely used in the real world? There's Haskell, Erlang, Clojure... Technically, you could do functional programming in Ruby and Python too, you just wouldn't be using some of the language's features.
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
September 16 2017 01:22 GMT
#18104
I think we use it because some of the school's sponsors push it

anyways I already ran into a snag, and I am reading a lot about it but it's just so confusing to figure this out



let head_equal_tail lst = match lst with
[] -> false
| h::[] -> false
| h::t -> true


This is fine. But not what I want. I want to see if h = t



let head_equal_tail lst = match lst with
[] -> false
| h::[] -> false
| h::t -> (h = t)


not ok...
"Error: This expression has type 'a list
but an expression was expected of type 'a
The type variable 'a occurs inside 'a list"

ok so.. it evaluates to bool but I can't use it because it's not the same type as everything else? well then how the hell am I supposed to do this in a reasonable way?
Manit0u
Profile Blog Joined August 2004
Poland17698 Posts
Last Edited: 2017-09-16 03:04:24
September 16 2017 02:29 GMT
#18105
I'm sorry. If it was Lisp or Clojure (or Erlang, or Python, or Ruby, or many other things) I might be able to help you. As it is, I don't know enough about OCaml to be of any help. The biggest problem with such niche languages is that it's very hard to find help, there have been no best practices developed by large enough community over the years etc. I'm afraid you're in the dark here and it will be bloody hard to get some light in there.

https://www.reddit.com/r/programming/comments/42s7i1/why_ocaml/
https://softwareengineering.stackexchange.com/questions/62685/why-isnt-ocaml-more-popular

Maybe this will help you: https://mitpress.mit.edu/sicp/full-text/book/book.html
Time is precious. Waste it wisely.
Hanh
Profile Joined June 2016
146 Posts
September 16 2017 02:51 GMT
#18106
The error says that the expression h=t is not valid. h is an element and t is a list.

If the list is 1,2,3,4
h=1
t=2,3,4
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2017-09-16 08:32:53
September 16 2017 08:23 GMT
#18107
On September 16 2017 10:22 travis wrote:
I think we use it because some of the school's sponsors push it

anyways I already ran into a snag, and I am reading a lot about it but it's just so confusing to figure this out



let head_equal_tail lst = match lst with
[] -> false
| h::[] -> false
| h::t -> true


This is fine. But not what I want. I want to see if h = t



let head_equal_tail lst = match lst with
[] -> false
| h::[] -> false
| h::t -> (h = t)


not ok...
"Error: This expression has type 'a list
but an expression was expected of type 'a
The type variable 'a occurs inside 'a list"

ok so.. it evaluates to bool but I can't use it because it's not the same type as everything else? well then how the hell am I supposed to do this in a reasonable way?

I haven't actually used OCaml or really any real functional language, so take it with a grain of salt. But from what I know, you're matching the input against a couple of patterns here:
[] -> lst is an empty list
h::[] -> lst has exactly one element h followed by an empty list
h::t -> lst has exactly one element h followed by a list t (tail) which could be empty if it wasn't for the the previous pattern

When deconstructing a list like that, you always have a single element as the head and the original list minus the head as the tail. The tail is always a list.
Now you obviously can't compare single elements to entire lists, OCaml has proper typing as far as I know.

What exactly do you want? That the tail t is also exactly one element and that element is equal to h? That the very last element in the tail is equal to h? Something else?

I'm not sure what OCaml offers you here, but for the very last element, I'd expect to have to use some existing function or recursion. For 1st = 2nd in lst, either you can match something like h1:h2::t (I have no idea what the syntax would be, intention is to match "2 heads" and the tail), or you use another pattern matching on t inside the 3rd pattern.


I think it's ok to use OCaml at university. It's a decent language from what I hear, at least for academic purposes. The important point is that you learn how functional programming works, and that's fairly independant from the actual language. If you want to be capable of using a language productively (at a job etc), you probably will have to put in way more time than what you'd need just for university anyways. And even if they used a more popular language at university, chances are it's still not the one that would be actually useful for you.
If you have a good reason to disagree with the above, please tell me. Thank you.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-09-16 12:29:11
September 16 2017 12:25 GMT
#18108
yeah you guys were exactly right, awesome

and manitou: i think what you are saying may actually be a part of the reason they picked ocaml. They want something that's a little bit harder to get help with, lol. they are dicks like that. It seems this class is largely about reading documentation and learning new languages quickly (in 4 or 5 weeks we switch again, to prolog). However, the documentation for ocaml is abysmal to read.
Manit0u
Profile Blog Joined August 2004
Poland17698 Posts
Last Edited: 2017-09-16 18:31:19
September 16 2017 18:28 GMT
#18109
On September 16 2017 21:25 travis wrote:
yeah you guys were exactly right, awesome

and manitou: i think what you are saying may actually be a part of the reason they picked ocaml. They want something that's a little bit harder to get help with, lol. they are dicks like that. It seems this class is largely about reading documentation and learning new languages quickly (in 4 or 5 weeks we switch again, to prolog). However, the documentation for ocaml is abysmal to read.


Wow. You can "learn" new language in a couple of days but it takes months to get semi-comfortable with it and years to actually understand it and know why some things are done this way rather than another. I really don't know what's the point of this course then. Learning new languages comes easier naturally with accumulated experience, not with force feeding them to people. If you only get 4-5 weeks of learning the language I can bet that in about 6 months you won't remember 99% of what you've learned (which, in my opinion, makes this entire exercise a waste of time). It's especially true for more esoteric languages (like OCaml and Prolog).

I've had a course in AI programming in Lisp at the university. It lasted entire year and I'm not sure I'd be able to write even a simple program in Lisp today without having to re-learn the basics. Good luck remembering something after just 4 weeks.
Time is precious. Waste it wisely.
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
September 16 2017 19:33 GMT
#18110
On September 17 2017 03:28 Manit0u wrote:
Show nested quote +
On September 16 2017 21:25 travis wrote:
yeah you guys were exactly right, awesome

and manitou: i think what you are saying may actually be a part of the reason they picked ocaml. They want something that's a little bit harder to get help with, lol. they are dicks like that. It seems this class is largely about reading documentation and learning new languages quickly (in 4 or 5 weeks we switch again, to prolog). However, the documentation for ocaml is abysmal to read.


Wow. You can "learn" new language in a couple of days but it takes months to get semi-comfortable with it and years to actually understand it and know why some things are done this way rather than another. I really don't know what's the point of this course then. Learning new languages comes easier naturally with accumulated experience, not with force feeding them to people. If you only get 4-5 weeks of learning the language I can bet that in about 6 months you won't remember 99% of what you've learned (which, in my opinion, makes this entire exercise a waste of time). It's especially true for more esoteric languages (like OCaml and Prolog).

I've had a course in AI programming in Lisp at the university. It lasted entire year and I'm not sure I'd be able to write even a simple program in Lisp today without having to re-learn the basics. Good luck remembering something after just 4 weeks.


I strongly disagree here.
At least not with the course being pointless. Yes, the language will neither be properly learned and even less will the language be remembered later on. But I don't think this is the goal anyway. (In fact, I don't believe teaching programming languages to a lasting effect is ever the goal at a university class...)

But given it's very special structure, really different from most classic languages, the course will still give insight in an entirely different approach to the whole topic of coding. Imho university classes are generally more focussed on putting you in different point of views, teaching your different approaches and general ideas how to tackle problems.

The real coding in the language of your choice is your job at home. This you have to do yourself. But learning how to properly think about the issue and how you could tackle the issue is the real key in those classes.

And I have seen enough people who know the languages, but don't know how to "think about coding". And the results of those are devastating. And working together in shared projects, and talking about how to do things is even worse.


And yes, today I don't remember a thing about my ultra short introduction into Haskell from almost a decade ago. But it still widened my horizon and this I actually kept. Same about PROLOG. I would never consider those classes a waste of time. I think it helped my skills, regardless the language I choose today.

Manit0u
Profile Blog Joined August 2004
Poland17698 Posts
September 16 2017 20:09 GMT
#18111
On September 17 2017 04:33 mahrgell wrote:
Show nested quote +
On September 17 2017 03:28 Manit0u wrote:
On September 16 2017 21:25 travis wrote:
yeah you guys were exactly right, awesome

and manitou: i think what you are saying may actually be a part of the reason they picked ocaml. They want something that's a little bit harder to get help with, lol. they are dicks like that. It seems this class is largely about reading documentation and learning new languages quickly (in 4 or 5 weeks we switch again, to prolog). However, the documentation for ocaml is abysmal to read.


Wow. You can "learn" new language in a couple of days but it takes months to get semi-comfortable with it and years to actually understand it and know why some things are done this way rather than another. I really don't know what's the point of this course then. Learning new languages comes easier naturally with accumulated experience, not with force feeding them to people. If you only get 4-5 weeks of learning the language I can bet that in about 6 months you won't remember 99% of what you've learned (which, in my opinion, makes this entire exercise a waste of time). It's especially true for more esoteric languages (like OCaml and Prolog).

I've had a course in AI programming in Lisp at the university. It lasted entire year and I'm not sure I'd be able to write even a simple program in Lisp today without having to re-learn the basics. Good luck remembering something after just 4 weeks.


I strongly disagree here.
At least not with the course being pointless. Yes, the language will neither be properly learned and even less will the language be remembered later on. But I don't think this is the goal anyway. (In fact, I don't believe teaching programming languages to a lasting effect is ever the goal at a university class...)

But given it's very special structure, really different from most classic languages, the course will still give insight in an entirely different approach to the whole topic of coding. Imho university classes are generally more focussed on putting you in different point of views, teaching your different approaches and general ideas how to tackle problems.

The real coding in the language of your choice is your job at home. This you have to do yourself. But learning how to properly think about the issue and how you could tackle the issue is the real key in those classes.

And I have seen enough people who know the languages, but don't know how to "think about coding". And the results of those are devastating. And working together in shared projects, and talking about how to do things is even worse.


And yes, today I don't remember a thing about my ultra short introduction into Haskell from almost a decade ago. But it still widened my horizon and this I actually kept. Same about PROLOG. I would never consider those classes a waste of time. I think it helped my skills, regardless the language I choose today.



I've never said that learning other languages is pointless. What is pointless is giving them just 4 weeks. It' not enough time in my opinion to really widen your horizons and teach you how to think about code. During this time you'll mostly just peruse the docs just to make the thing you're trying to do work. For the language to broaden your thinking you need to "get it" and understand what's so different about it from other languages you've been working with apart from the syntax. You can only do that once you're somewhat comfortable with the language and its structure, when you no longer need to focus on trivial stuff like "How do I properly iterate/recurse/map/reduce this structure here?".
Time is precious. Waste it wisely.
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
September 16 2017 20:26 GMT
#18112
On September 17 2017 05:09 Manit0u wrote:
Show nested quote +
On September 17 2017 04:33 mahrgell wrote:
On September 17 2017 03:28 Manit0u wrote:
On September 16 2017 21:25 travis wrote:
yeah you guys were exactly right, awesome

and manitou: i think what you are saying may actually be a part of the reason they picked ocaml. They want something that's a little bit harder to get help with, lol. they are dicks like that. It seems this class is largely about reading documentation and learning new languages quickly (in 4 or 5 weeks we switch again, to prolog). However, the documentation for ocaml is abysmal to read.


Wow. You can "learn" new language in a couple of days but it takes months to get semi-comfortable with it and years to actually understand it and know why some things are done this way rather than another. I really don't know what's the point of this course then. Learning new languages comes easier naturally with accumulated experience, not with force feeding them to people. If you only get 4-5 weeks of learning the language I can bet that in about 6 months you won't remember 99% of what you've learned (which, in my opinion, makes this entire exercise a waste of time). It's especially true for more esoteric languages (like OCaml and Prolog).

I've had a course in AI programming in Lisp at the university. It lasted entire year and I'm not sure I'd be able to write even a simple program in Lisp today without having to re-learn the basics. Good luck remembering something after just 4 weeks.


I strongly disagree here.
At least not with the course being pointless. Yes, the language will neither be properly learned and even less will the language be remembered later on. But I don't think this is the goal anyway. (In fact, I don't believe teaching programming languages to a lasting effect is ever the goal at a university class...)

But given it's very special structure, really different from most classic languages, the course will still give insight in an entirely different approach to the whole topic of coding. Imho university classes are generally more focussed on putting you in different point of views, teaching your different approaches and general ideas how to tackle problems.

The real coding in the language of your choice is your job at home. This you have to do yourself. But learning how to properly think about the issue and how you could tackle the issue is the real key in those classes.

And I have seen enough people who know the languages, but don't know how to "think about coding". And the results of those are devastating. And working together in shared projects, and talking about how to do things is even worse.


And yes, today I don't remember a thing about my ultra short introduction into Haskell from almost a decade ago. But it still widened my horizon and this I actually kept. Same about PROLOG. I would never consider those classes a waste of time. I think it helped my skills, regardless the language I choose today.



I've never said that learning other languages is pointless. What is pointless is giving them just 4 weeks. It' not enough time in my opinion to really widen your horizons and teach you how to think about code. During this time you'll mostly just peruse the docs just to make the thing you're trying to do work. For the language to broaden your thinking you need to "get it" and understand what's so different about it from other languages you've been working with apart from the syntax. You can only do that once you're somewhat comfortable with the language and its structure, when you no longer need to focus on trivial stuff like "How do I properly iterate/recurse/map/reduce this structure here?".


Well... Imho the more different the language is, the less time is needed for the student to extract some new approach here. It isn't about mastery.
And given how much you have to bend your mind to "How do I properly iterate/recurse/map/reduce this structure here?" here, you are actually already learning here.


Most people, being thrown into a new language, will often produce code which looks almost like what they would have written in their language of origin. There are 2 big moments of learning, usually:
a) the moment you realize you can't do things the way you always have done, and now have to figure out how to do it here
b) the moment you realize, you can do things more efficient using the new language, instead of following your old ways.

b) is entirely out of reach for such super short introductions. And the moment you reach this point is probably the farther away, the more different the languages are.
But a) is the opposite. It actually happens much earlier, when the languages are super different. In this case, it already happens at the "How do I properly iterate/recurse/map/reduce this structure here?" stage. If the course only wants to grab this eye-opening moment.... This can be done in 4 weeks. Introduce it with some examples, let people repeat those simple examples, then let people apply those simple examples for slightly more advanced functions, like he posted above. Add an outlook, and you grabbed a good effect/time ratio.

And here it actually makes sense to pick some language which is more difficult to find c+p solutions for online. Because c+p is probably the killer of the entire a)-type learning. :D
Liebig
Profile Joined August 2010
France738 Posts
September 16 2017 22:14 GMT
#18113
On September 16 2017 01:11 Manit0u wrote:
I'd love to work on such project.

And regarding your classes: why the hell would they choose OCaml to teach you functional programming instead of something that's more widely used in the real world? There's Haskell, Erlang, Clojure... Technically, you could do functional programming in Ruby and Python too, you just wouldn't be using some of the language's features.

I think it's fairly debatable to say that Haskell is more widely used than OCaml in the real world, they're both pretty much niche.

Facebook both uses Haskell and OCaml btw. Haskell for their spam infrastructure iirc and OCaml for some static analysis tool.
Liebig
Profile Joined August 2010
France738 Posts
September 16 2017 22:26 GMT
#18114
On September 15 2017 22:45 travis wrote:
Anything crucial I should know? I know that everything is immutable in ocaml, which I guess is kind of the point with functional programming?

That's wrong. OCaml isn't pure.

You can write a counter function for example.

# let count = let x = ref 0 in let foo () = incr x; !x in foo;;
val count : unit -> int = <fun>
# count ();;
- : int = 1
# count ();;
- : int = 2
# count ();;
- : int = 3
# count ();;
- : int = 4
Acrofales
Profile Joined August 2010
Spain18240 Posts
September 17 2017 09:12 GMT
#18115
On September 16 2017 10:22 travis wrote:
I think we use it because some of the school's sponsors push it

anyways I already ran into a snag, and I am reading a lot about it but it's just so confusing to figure this out



let head_equal_tail lst = match lst with
[] -> false
| h::[] -> false
| h::t -> true


This is fine. But not what I want. I want to see if h = t



let head_equal_tail lst = match lst with
[] -> false
| h::[] -> false
| h::t -> (h = t)


not ok...
"Error: This expression has type 'a list
but an expression was expected of type 'a
The type variable 'a occurs inside 'a list"

ok so.. it evaluates to bool but I can't use it because it's not the same type as everything else? well then how the hell am I supposed to do this in a reasonable way?


Hanh already pointed it out, but tail is a list. I don't know the exact syntax of ocaml, but you'll want to do something of the kind:




let head_equal_tail lst = match lst with
[] -> false
| h::[] -> false
| h1::h2::t -> (h1 = h2)


That will return true if the first 2 elements of your list are equal (assuming the syntax is correct, which I cannot help you with), and otherwise false.
aRyuujin
Profile Blog Joined January 2011
United States5049 Posts
September 17 2017 21:56 GMT
#18116
On September 17 2017 07:14 Liebig wrote:
Show nested quote +
On September 16 2017 01:11 Manit0u wrote:
I'd love to work on such project.

And regarding your classes: why the hell would they choose OCaml to teach you functional programming instead of something that's more widely used in the real world? There's Haskell, Erlang, Clojure... Technically, you could do functional programming in Ruby and Python too, you just wouldn't be using some of the language's features.

I think it's fairly debatable to say that Haskell is more widely used than OCaml in the real world, they're both pretty much niche.

Facebook both uses Haskell and OCaml btw. Haskell for their spam infrastructure iirc and OCaml for some static analysis tool.


i am a haskell programmer, there is a decent haskell community, ocaml seems popular in fintech though
can i get my estro logo back pls
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
Last Edited: 2017-09-18 19:40:07
September 18 2017 19:39 GMT
#18117
On September 18 2017 06:56 aRyuujin wrote:
Show nested quote +
On September 17 2017 07:14 Liebig wrote:
On September 16 2017 01:11 Manit0u wrote:
I'd love to work on such project.

And regarding your classes: why the hell would they choose OCaml to teach you functional programming instead of something that's more widely used in the real world? There's Haskell, Erlang, Clojure... Technically, you could do functional programming in Ruby and Python too, you just wouldn't be using some of the language's features.

I think it's fairly debatable to say that Haskell is more widely used than OCaml in the real world, they're both pretty much niche.

Facebook both uses Haskell and OCaml btw. Haskell for their spam infrastructure iirc and OCaml for some static analysis tool.


i am a haskell programmer, there is a decent haskell community, ocaml seems popular in fintech though

Its always funny seeing OCaml randomly in the wild somewhere, for instance I just found out that one of the biggest unikernels MirageOS is written in OCaml.

Also do you use Haskell at your job?
The harder it becomes, the more you should focus on the basics.
Manit0u
Profile Blog Joined August 2004
Poland17698 Posts
September 20 2017 23:56 GMT
#18118
Guys, I need a bit of help with conceptual work. Maybe some of you have had any experience with something like that before...

Basically it's all about process pipelining. We create the configuration and then each process step (step in the pipeline) receives some input files and produces some output files. The problem I'm facing at the moment is that different processes require different file and I need to map the correlations.

Example:

Process A has input files a, b, c and produces output files d, e.
Process B has input files f, g and produces output file h.

All the inputs/outputs need to be unique (it matters which one is which, don't ask me why) so when I go to the next step in the pipeline (process A finished) I need to know that I have to pass output d as input g and output e as input f so that process B can start.

I can't discover/calculate this on the fly since process configuration might change but all of the old jobs (series of steps) have to retain their old configuration.

Now. What do you think would be the best way to map such configurations in the database (postgres) so that it isn't too clunky to retrieve/parse?

The only thing I came up with this far is some form of config table, which will be attached to the process (one process has many configs and each config specifies the relation between output of this process and input of the next one) but this seems super fragile...
Time is precious. Waste it wisely.
NovemberstOrm
Profile Blog Joined September 2011
Canada16217 Posts
September 22 2017 03:54 GMT
#18119
Anyone familiar with Moment JS? And knows how to parse dates/time pulled from an API(json format) into only hours/minutes?
Moderatorlickypiddy
Acrofales
Profile Joined August 2010
Spain18240 Posts
September 22 2017 05:24 GMT
#18120
On September 21 2017 08:56 Manit0u wrote:
Guys, I need a bit of help with conceptual work. Maybe some of you have had any experience with something like that before...

Basically it's all about process pipelining. We create the configuration and then each process step (step in the pipeline) receives some input files and produces some output files. The problem I'm facing at the moment is that different processes require different file and I need to map the correlations.

Example:

Process A has input files a, b, c and produces output files d, e.
Process B has input files f, g and produces output file h.

All the inputs/outputs need to be unique (it matters which one is which, don't ask me why) so when I go to the next step in the pipeline (process A finished) I need to know that I have to pass output d as input g and output e as input f so that process B can start.

I can't discover/calculate this on the fly since process configuration might change but all of the old jobs (series of steps) have to retain their old configuration.

Now. What do you think would be the best way to map such configurations in the database (postgres) so that it isn't too clunky to retrieve/parse?

The only thing I came up with this far is some form of config table, which will be attached to the process (one process has many configs and each config specifies the relation between output of this process and input of the next one) but this seems super fragile...


Why a postgres database? It sounds like you are trying to find a formal way of describing the structure of your relations, and not just the relations themselves. So you would want a language capable of representing and reasoning about the relational model of your database. That's a subset of first order logic, so mb look into that: by the sound of it, you could use prolog to do it fairly easily. You could also use OWL. These languages are built for reasoning about relations in a broader sense than SQL is. For instance, you can write the rules governing the system in the same language, for instance you can write in first order logic rules such as:

\forall b in Processes: \forall i in Wires: if input(, w) then (w in ProblemInputs or \exists b' in Processes \exists w' in Wires: b != b' and w != w' and output(b', w')

Or in language: all inputs of all your processes are properly connected. This can be done in Prolog and some flavors of OWL (which one is sometimes a bit tricky to figure out).

You can then verify that whatever configuration your user came up with satisfies the rules of the system.
Prev 1 904 905 906 907 908 1032 Next
Please log in or register to reply.
Live Events Refresh
Wardi Open
12:00
#79
WardiTV711
OGKoka 384
Rex102
IntoTheiNu 44
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko412
OGKoka 384
Harstem 183
ProTech130
Rex 112
LamboSC2 104
MindelVK 10
StarCraft: Brood War
Calm 13131
Bisu 2499
Horang2 1898
Jaedong 1407
Shuttle 1133
Hyuk 653
BeSt 457
Larva 415
Stork 379
Mini 247
[ Show more ]
Light 227
Leta 221
Zeus 173
Rush 130
Soma 130
Snow 120
Pusan 115
ggaemo 97
Backho 91
PianO 75
Shine 65
Shinee 60
ToSsGirL 55
Hm[arnc] 34
Nal_rA 34
yabsab 31
Movie 28
Free 25
[sc1f]eonzerg 22
zelot 20
soO 19
IntoTheRainbow 18
GoRush 17
sorry 17
Bale 16
ajuk12(nOOB) 11
Noble 9
Terrorterran 8
Dota 2
Gorgc5282
League of Legends
Reynor9
Counter-Strike
fl0m2477
olofmeister1218
shoxiejesuss693
kennyS663
byalli502
Fnx 0
Other Games
singsing1985
B2W.Neo775
hiko581
XBOCT517
crisheroes313
Beastyqt176
Sick101
Mew2King47
ArmadaUGS43
Organizations
Dota 2
PGL Dota 2 - Main Stream52
StarCraft: Brood War
lovetv 22
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• StrangeGG 24
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 31
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
Monday Night Weeklies
3h 36m
Sparkling Tuna Cup
20h 36m
Afreeca Starleague
20h 36m
Soulkey vs Ample
JyJ vs sSak
Replay Cast
1d 19h
Afreeca Starleague
1d 20h
hero vs YSC
Larva vs Shine
Kung Fu Cup
1d 21h
Replay Cast
2 days
KCM Race Survival
2 days
The PondCast
2 days
WardiTV Team League
2 days
[ Show More ]
Replay Cast
3 days
WardiTV Team League
3 days
RSL Revival
4 days
Cure vs Zoun
herO vs Rogue
WardiTV Team League
4 days
Platinum Heroes Events
5 days
BSL
5 days
RSL Revival
5 days
ByuN vs Maru
MaxPax vs TriGGeR
WardiTV Team League
5 days
BSL
6 days
Replay Cast
6 days
Afreeca Starleague
6 days
Light vs Calm
Royal vs Mind
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2026-03-22
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
BSL Season 22
CSL Elite League 2026
CSL Season 20: Qualifier 1
ASL Season 21
Acropolis #4 - TS6
RSL Revival: Season 4
Nations Cup 2026
NationLESS Cup
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

2026 Changsha Offline CUP
CSL Season 20: Qualifier 2
CSL 2026 SPRING (S20)
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.