<commit_before>class Global {
	1 messages: List of Message
}

class Message {
	1 body: Text
}

let userInput = ""

<link rel="stylesheet" href="examples/chat.css" />

<div class="chat">
	<input data=userInput class="messageInput"/>
	<button>"Send"</button onClick=handler() {
		let newMessage = new { text: userInput }
		userInput.set("")
		global.messages.unshift(newMessage)
	}>
	<div class="messages">
		for (message in global.messages) {
			<div class="message"> message.text </div>
		}
	</div>
</div>
<commit_msg>Rewrite chat example to use interfaces rather than classes<commit_after>#import WebSocket

let Message = { body:Text }

let [Message] messages = []

WebSocket.on('message', handler(Message message) { messages.push(message) })

<div class="chat">
	let input = ""
	<input data=input />
	<button>"Send"</button onClick=handler() {
		let message = { body:input }
		input.set('')
		WebSocket.send('message', message)
		messages.push(message)
	}>
	<div class="messages">
		for (message in messages) {
			<div class="message"> message.body </div>
		}
	</div>
</div>

{'fraction_non_alphanumeric': 0.16434540389972144, 'fraction_numerical': 0.0018570102135561746, 'mean_word_length': 4.528205128205128, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1256017', 'n_tokens_mistral': 375, 'n_tokens_neox': 353, 'n_words': 90}